Skip to content

Commit

Permalink
Merge branch 'main' into omnetpp-msg
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgeorge309 authored Nov 25, 2024
2 parents 63627d6 + 120e0e5 commit 693eb30
Show file tree
Hide file tree
Showing 66 changed files with 4,982 additions and 224 deletions.
30 changes: 21 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,6 @@
[submodule "vendor/grammars/atom-fstar"]
path = vendor/grammars/atom-fstar
url = https://github.com/FStarLang/atom-fstar
[submodule "vendor/grammars/atom-language-1c-bsl"]
path = vendor/grammars/atom-language-1c-bsl
url = https://github.com/xDrivenDevelopment/atom-language-1c-bsl.git
[submodule "vendor/grammars/atom-language-clean"]
path = vendor/grammars/atom-language-clean
url = https://github.com/timjs/atom-language-clean.git
Expand Down Expand Up @@ -389,9 +386,6 @@
[submodule "vendor/grammars/clarity.tmbundle"]
path = vendor/grammars/clarity.tmbundle
url = https://github.com/hirosystems/clarity.tmbundle.git
[submodule "vendor/grammars/cmake.tmbundle"]
path = vendor/grammars/cmake.tmbundle
url = https://github.com/textmate/cmake.tmbundle
[submodule "vendor/grammars/code-peggy-language"]
path = vendor/grammars/code-peggy-language
url = https://github.com/peggyjs/code-peggy-language.git
Expand Down Expand Up @@ -833,6 +827,9 @@
[submodule "vendor/grammars/language-toc-wow"]
path = vendor/grammars/language-toc-wow
url = https://github.com/nebularg/language-toc-wow
[submodule "vendor/grammars/language-tools"]
path = vendor/grammars/language-tools
url = https://github.com/vuejs/language-tools.git
[submodule "vendor/grammars/language-tsql"]
path = vendor/grammars/language-tsql
url = https://github.com/beau-witter/language-tsql
Expand Down Expand Up @@ -926,6 +923,9 @@
[submodule "vendor/grammars/monkey"]
path = vendor/grammars/monkey
url = https://github.com/gingerbeardman/monkey.tmbundle
[submodule "vendor/grammars/moonbit-tmLanguage"]
path = vendor/grammars/moonbit-tmLanguage
url = https://github.com/moonbitlang/moonbit-tmLanguage.git
[submodule "vendor/grammars/moonscript-tmbundle"]
path = vendor/grammars/moonscript-tmbundle
url = https://github.com/leafo/moonscript-tmbundle
Expand Down Expand Up @@ -953,6 +953,9 @@
[submodule "vendor/grammars/omnetpp-textmate-msg"]
path = vendor/grammars/omnetpp-textmate-msg
url = https://github.com/omnetpp/omnetpp-textmate-msg.git
[submodule "vendor/grammars/omnetpp-textmate-ned"]
path = vendor/grammars/omnetpp-textmate-ned
url = https://github.com/omnetpp/omnetpp-textmate-ned.git
[submodule "vendor/grammars/ooc.tmbundle"]
path = vendor/grammars/ooc.tmbundle
url = https://github.com/nilium/ooc.tmbundle
Expand Down Expand Up @@ -1217,6 +1220,9 @@
[submodule "vendor/grammars/syntax-mcfunction"]
path = vendor/grammars/syntax-mcfunction
url = https://github.com/MinecraftCommands/syntax-mcfunction.git
[submodule "vendor/grammars/tact-sublime"]
path = vendor/grammars/tact-sublime
url = https://github.com/tact-lang/tact-sublime.git
[submodule "vendor/grammars/tcl.tmbundle"]
path = vendor/grammars/tcl.tmbundle
url = https://github.com/textmate/tcl.tmbundle
Expand All @@ -1241,6 +1247,9 @@
[submodule "vendor/grammars/turtle.tmbundle"]
path = vendor/grammars/turtle.tmbundle
url = https://github.com/peta/turtle.tmbundle
[submodule "vendor/grammars/typespec"]
path = vendor/grammars/typespec
url = https://github.com/microsoft/typespec.git
[submodule "vendor/grammars/typst-grammar"]
path = vendor/grammars/typst-grammar
url = https://github.com/michidk/typst-grammar.git
Expand All @@ -1256,6 +1265,9 @@
[submodule "vendor/grammars/vsc-fennel"]
path = vendor/grammars/vsc-fennel
url = https://github.com/kongeor/vsc-fennel
[submodule "vendor/grammars/vsc-language-1c-bsl"]
path = vendor/grammars/vsc-language-1c-bsl
url = https://github.com/1c-syntax/vsc-language-1c-bsl.git
[submodule "vendor/grammars/vscode-TalonScript"]
path = vendor/grammars/vscode-TalonScript
url = https://github.com/mrob95/vscode-TalonScript.git
Expand All @@ -1274,6 +1286,9 @@
[submodule "vendor/grammars/vscode-cadence"]
path = vendor/grammars/vscode-cadence
url = https://github.com/onflow/vscode-cadence.git
[submodule "vendor/grammars/vscode-cmake-tools"]
path = vendor/grammars/vscode-cmake-tools
url = https://github.com/microsoft/vscode-cmake-tools.git
[submodule "vendor/grammars/vscode-codeql"]
path = vendor/grammars/vscode-codeql
url = https://github.com/github/vscode-codeql
Expand Down Expand Up @@ -1407,9 +1422,6 @@
[submodule "vendor/grammars/vscode_mikrotik_routeros_script"]
path = vendor/grammars/vscode_mikrotik_routeros_script
url = https://github.com/devMikeUA/vscode_mikrotik_routeros_script.git
[submodule "vendor/grammars/vue-syntax-highlight"]
path = vendor/grammars/vue-syntax-highlight
url = https://github.com/vuejs/vue-syntax-highlight
[submodule "vendor/grammars/wgsl-analyzer"]
path = vendor/grammars/wgsl-analyzer
url = https://github.com/wgsl-analyzer/wgsl-analyzer.git
Expand Down
29 changes: 21 additions & 8 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ vendor/grammars/atom-firestore-grammar:
- source.firestore
vendor/grammars/atom-fstar:
- source.fstar
vendor/grammars/atom-language-1c-bsl:
- source.bsl
- source.sdbl
vendor/grammars/atom-language-clean:
- source.clean
- text.restructuredtext.clean
Expand Down Expand Up @@ -318,9 +315,6 @@ vendor/grammars/circom-highlighting-vscode:
- source.circom
vendor/grammars/clarity.tmbundle:
- source.clar
vendor/grammars/cmake.tmbundle:
- source.cache.cmake
- source.cmake
vendor/grammars/code-peggy-language:
- inline.peggy
- source.peggy
Expand Down Expand Up @@ -793,6 +787,13 @@ vendor/grammars/language-ti-basic:
- source.8xp
vendor/grammars/language-toc-wow:
- source.toc
vendor/grammars/language-tools:
- markdown.vue.codeblock
- mdx.vue.codeblock
- source.vue
- vue.directives
- vue.interpolations
- vue.sfc.style.variable.injection
vendor/grammars/language-tsql:
- source.tsql
vendor/grammars/language-turing:
Expand Down Expand Up @@ -865,6 +866,8 @@ vendor/grammars/mojo-syntax:
- source.mojo
vendor/grammars/monkey:
- source.monkey
vendor/grammars/moonbit-tmLanguage:
- source.moonbit
vendor/grammars/moonscript-tmbundle:
- source.moonscript
vendor/grammars/nemerle.tmbundle:
Expand All @@ -889,6 +892,8 @@ vendor/grammars/ocaml.tmbundle:
- source.ocamlyacc
vendor/grammars/omnetpp-textmate-msg:
- source.msg
vendor/grammars/omnetpp-textmate-ned:
- source.ned
vendor/grammars/ooc.tmbundle:
- source.ooc
vendor/grammars/opa.tmbundle:
Expand Down Expand Up @@ -1086,6 +1091,8 @@ vendor/grammars/syntax:
- source.sentinel
vendor/grammars/syntax-mcfunction:
- source.mcfunction
vendor/grammars/tact-sublime:
- source.tact
vendor/grammars/tcl.tmbundle:
- source.tcl
- text.html.tcl
Expand All @@ -1107,6 +1114,8 @@ vendor/grammars/toml.tmbundle:
vendor/grammars/turtle.tmbundle:
- source.sparql
- source.turtle
vendor/grammars/typespec:
- source.tsp
vendor/grammars/typst-grammar:
- source.typst
vendor/grammars/verilog.tmbundle:
Expand All @@ -1122,6 +1131,9 @@ vendor/grammars/vsc-ember-syntax:
- text.html.ember-handlebars
vendor/grammars/vsc-fennel:
- source.fnl
vendor/grammars/vsc-language-1c-bsl:
- source.bsl
- source.sdbl
vendor/grammars/vscode-TalonScript:
- markdown.talon.codeblock
- source.talon
Expand All @@ -1138,6 +1150,9 @@ vendor/grammars/vscode-caddyfile:
vendor/grammars/vscode-cadence:
- markdown.cadence.codeblock
- source.cadence
vendor/grammars/vscode-cmake-tools:
- source.cmake
- source.cmakecache
vendor/grammars/vscode-codeql:
- source.ql
vendor/grammars/vscode-cue:
Expand Down Expand Up @@ -1279,8 +1294,6 @@ vendor/grammars/vscode_cobol:
- source.utreport
vendor/grammars/vscode_mikrotik_routeros_script:
- source.rsc
vendor/grammars/vue-syntax-highlight:
- text.html.vue
vendor/grammars/wgsl-analyzer:
- source.wgsl
vendor/grammars/witcherscript-grammar:
Expand Down
31 changes: 31 additions & 0 deletions lib/linguist/generated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def generated?
poetry_lock? ||
pdm_lock? ||
uv_lock? ||
pixi_lock? ||
esy_lock? ||
npm_shrinkwrap_or_package_lock? ||
pnpm_lock? ||
Expand All @@ -91,6 +92,7 @@ def generated?
generated_protocol_buffer_from_go? ||
generated_protocol_buffer? ||
generated_javascript_protocol_buffer? ||
generated_typescript_protocol_buffer? ||
generated_apache_thrift? ||
generated_jni_header? ||
vcr_cassette? ||
Expand Down Expand Up @@ -367,6 +369,28 @@ def generated_javascript_protocol_buffer?
return lines[5].include?("GENERATED CODE -- DO NOT EDIT!")
end

# Internal: Is the blob a TypeScript source file generated by the
# Protocol Buffer compiler?
#
# Files generated by ts-proto typically start with something like this
# (though the versions lines are optional):
#
# // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
# // versions:
# // protoc-gen-ts_proto v1.181.2
# // protoc v5.28.2
# // source: hello.proto
#
# /* eslint-disable */
#
# Returns true or false.
def generated_typescript_protocol_buffer?
return false unless extname == ".ts"
return false unless lines.count > 4

return lines[0].include?("Code generated by protoc-gen-ts_proto. DO NOT EDIT.")
end

APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp', '.php']

# Internal: Is the blob generated by Apache Thrift compiler?
Expand Down Expand Up @@ -431,6 +455,13 @@ def uv_lock?
!!name.match(/uv\.lock/)
end

# Internal: Is the blob a generated pixi lock file?
#
# Returns true or false.
def pixi_lock?
!!name.match(/pixi\.lock/)
end

# Internal: Is the blob a generated esy lock file?
#
# Returns true or false.
Expand Down
26 changes: 17 additions & 9 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,12 @@ disambiguations:
rules:
- language: B4X
pattern: '\A\W{0,3}(?:.*(?:\r?\n|\r)){0,9}B4(?:J|A|R|i)=true'
- language: FreeBasic
- language: FreeBASIC
pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|include|lang|macro)(?:$|\s)'
- language: BASIC
pattern: '\A\s*\d'
- language: VBA
and:
- named_pattern: vb-module
- named_pattern: vba
named_pattern: vba
- language: Visual Basic 6.0
named_pattern: vb-module
- extensions: ['.bb']
Expand All @@ -120,7 +118,7 @@ disambiguations:
pattern: '(>\+>|>\+<)'
- extensions: ['.bi']
rules:
- language: FreeBasic
- language: FreeBASIC
pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|if|include|lang|macro)(?:$|\s)'
- extensions: ['.bs']
rules:
Expand Down Expand Up @@ -757,6 +755,11 @@ disambiguations:
pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)'
- language: Turing
pattern: '^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+'
- extensions: ['.tact']
rules:
- language: JSON
pattern: '\A\s*\{\"'
- language: Tact
- extensions: ['.tag']
rules:
- language: Java Server Pages
Expand All @@ -776,6 +779,12 @@ disambiguations:
- language: XML
pattern: '<TS\b'
- language: TypeScript
- extensions: ['.tsp']
rules:
- language: TypeSpec
pattern: '^(import|using|namespace|interface|op|model|scalar|alias|union|enum)\s'
- language: TSPLIB data
pattern: '^(NAME|TYPE|DIMENSION|EDGE_WEIGHT_TYPE|EDGE_WEIGHT_FORMAT)\s*:'
- extensions: ['.tst']
rules:
- language: GAP
Expand All @@ -784,10 +793,9 @@ disambiguations:
- language: Scilab
- extensions: ['.tsx']
rules:
- language: TSX
pattern: '^\s*(import.+(from\s+|require\()[''"]react|\/\/\/\s*<reference\s)'
- language: XML
pattern: '(?i:^\s*<\?xml\s+version)'
- language: TSX
- extensions: ['.txt']
rules:
# The following RegExp is simply a collapsed and simplified form of the
Expand Down Expand Up @@ -956,12 +964,12 @@ named_patterns:
- '^[ ]*#If Win64\b'
- '^[ ]*(?:Dim|Const) [0-9a-zA-Z_]*[ ]*As Long(?:Ptr|Long)\b'
# Top module declarations unique to VBA
- '^[ ]*Option (?:Private Module|Compare (?:Database|Text|Binary))\b'
- '^[ ]*Option (?:Private Module|Compare Database)\b'
# General VBA libraries and objects
- '(?: |\()(?:Access|Excel|Outlook|PowerPoint|Visio|Word|VBIDE)\.\w'
- '\b(?:(?:Active)?VBProjects?|VBComponents?|Application\.(?:VBE|ScreenUpdating))\b'
# AutoCAD, Outlook, PowerPoint and Word objects
- '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Find|Paragraphs))\b'
- '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Document|Find|Paragraphs|Range))\b'
# Excel objects
- '\b(?:(?:This|Active)?Workbooks?|Worksheets?|Active(?:Sheet|Chart|Cell)|WorksheetFunction)\b'
- '\b(?:Range\(".*|Cells\([0-9a-zA-Z_]*, (?:[0-9a-zA-Z_]*|"[a-zA-Z]{1,3}"))\)'
Loading

0 comments on commit 693eb30

Please sign in to comment.