Skip to content

Commit

Permalink
Merge branch 'main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jiashengguo authored Jan 15, 2025
2 parents 5cb4bde + be39d09 commit a6e5cf0
Show file tree
Hide file tree
Showing 53 changed files with 3,772 additions and 50 deletions.
21 changes: 18 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@
[submodule "vendor/grammars/antlr.tmbundle"]
path = vendor/grammars/antlr.tmbundle
url = https://github.com/textmate/antlr.tmbundle
[submodule "vendor/grammars/apache.tmbundle"]
path = vendor/grammars/apache.tmbundle
url = https://github.com/textmate/apache.tmbundle
[submodule "vendor/grammars/apex-tmLanguage"]
path = vendor/grammars/apex-tmLanguage
url = https://github.com/forcedotcom/apex-tmLanguage.git
Expand All @@ -275,6 +272,9 @@
[submodule "vendor/grammars/asciidoc.tmbundle"]
path = vendor/grammars/asciidoc.tmbundle
url = https://github.com/zuckschwerdt/asciidoc.tmbundle
[submodule "vendor/grammars/asp-syntax-highlight"]
path = vendor/grammars/asp-syntax-highlight
url = https://github.com/nickswalker/asp-syntax-highlight.git
[submodule "vendor/grammars/asp.tmbundle"]
path = vendor/grammars/asp.tmbundle
url = https://github.com/textmate/asp.tmbundle
Expand Down Expand Up @@ -965,6 +965,9 @@
[submodule "vendor/grammars/openscad.tmbundle"]
path = vendor/grammars/openscad.tmbundle
url = https://github.com/tbuser/openscad.tmbundle
[submodule "vendor/grammars/overpassql-tmlanguage"]
path = vendor/grammars/overpassql-tmlanguage
url = https://github.com/nickswalker/overpassql-tmlanguage.git
[submodule "vendor/grammars/oz-tmbundle"]
path = vendor/grammars/oz-tmbundle
url = https://github.com/eregon/oz-tmbundle
Expand Down Expand Up @@ -1277,6 +1280,9 @@
[submodule "vendor/grammars/vscode-antlers-language-server"]
path = vendor/grammars/vscode-antlers-language-server
url = https://github.com/Stillat/vscode-antlers-language-server.git
[submodule "vendor/grammars/vscode-apache"]
path = vendor/grammars/vscode-apache
url = https://github.com/mrmlnc/vscode-apache.git
[submodule "vendor/grammars/vscode-bitbake"]
path = vendor/grammars/vscode-bitbake
url = https://github.com/yoctoproject/vscode-bitbake.git
Expand Down Expand Up @@ -1341,6 +1347,9 @@
[submodule "vendor/grammars/vscode-just"]
path = vendor/grammars/vscode-just
url = https://github.com/nefrob/vscode-just.git
[submodule "vendor/grammars/vscode-kdl"]
path = vendor/grammars/vscode-kdl
url = https://github.com/kdl-org/vscode-kdl.git
[submodule "vendor/grammars/vscode-lean"]
path = vendor/grammars/vscode-lean
url = https://github.com/leanprover/vscode-lean
Expand All @@ -1350,6 +1359,9 @@
[submodule "vendor/grammars/vscode-livecodescript"]
path = vendor/grammars/vscode-livecodescript
url = https://github.com/Ferruslogic/vscode-livecodescript.git
[submodule "vendor/grammars/vscode-minizinc"]
path = vendor/grammars/vscode-minizinc
url = https://github.com/Dekker1/vscode-minizinc.git
[submodule "vendor/grammars/vscode-monkey-c"]
path = vendor/grammars/vscode-monkey-c
url = https://github.com/ghisguth/vscode-monkey-c
Expand Down Expand Up @@ -1437,6 +1449,9 @@
[submodule "vendor/grammars/xc.tmbundle"]
path = vendor/grammars/xc.tmbundle
url = https://github.com/graymalkin/xc.tmbundle
[submodule "vendor/grammars/xmake-lua.tmbundle"]
path = vendor/grammars/xmake-lua.tmbundle
url = https://github.com/xmake-io/xmake-lua.tmbundle
[submodule "vendor/grammars/xml.tmbundle"]
path = vendor/grammars/xml.tmbundle
url = https://github.com/textmate/xml.tmbundle
Expand Down
7 changes: 3 additions & 4 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ If you have not made any changes to your repository in a while, you may find pus

There are a few reasons that could lead to this outcome:

1. If the repository implements an override via the `linguist-language` attribute, it won't be taken into account in GitHub's search results since GitHub Search relies on [go-enry](https://github.com/go-enry/go-enry) which doesn't support overrides at the moment ([More info](https://github.com/src-d/enry/issues/18)).
2. go-enry might not be using the latest version of Linguist which means that files could be detected differently in search compared to Linguist (see also the note at the end of [this section](#my-linguist-pr-has-been-merged-but-github-doesnt-reflect-my-changes)).
1. If the repository implements an override via the `linguist-language` attribute, it won't be taken into account in GitHub's search results since GitHub search relies on an internal library which doesn't support overrides at the moment.
2. GitHub's search internal library might not be using the latest version of Linguist which means that files could be detected differently in search compared to Linguist (see also the note at the end of [this section](#my-linguist-pr-has-been-merged-but-github-doesnt-reflect-my-changes)).
3. It could be that files are associated to a language that is part of a group. This means that they are counted as the parent language in the language stats bar, but as the actual language in search. For instance, a file ending with `.f90` is considered to be "Fortran" in the stats bar, but "Fortran Free Form" in search.
4. Finally, this can be caused by [code search limitations](https://docs.github.com/en/search-github/github-code-search/about-github-code-search#limitations) that are unrelated to Linguist.

Expand Down Expand Up @@ -78,5 +78,4 @@ All syntax highlighting grammars will also be updated in all major and minor rel
Grammars will only be updated in patch releases if the patch release is specifically for that language and it requires a grammar update to address the issue.

Note: New languages will not appear in GitHub's search results for some time after the pull request has been merged and the new Linguist release deployed to GitHub.com.
This is because GitHub's search uses [go-enry](https://github.com/go-enry/go-enry) for language detection which tends to lag behind Linguist by a few weeks to months.
This in turn requires an update to the underlying search code once go-enry is inline with Linguist.
This is because GitHub's search uses a separate internal library for language detection which tends to lag behind Linguist by a few weeks to months.
15 changes: 12 additions & 3 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ vendor/grammars/ant.tmbundle:
- text.xml.ant
vendor/grammars/antlr.tmbundle:
- source.antlr
vendor/grammars/apache.tmbundle:
- source.apache-config
- source.apache-config.mod_perl
vendor/grammars/apex-tmLanguage:
- source.apex
- source.soql
Expand All @@ -224,6 +221,8 @@ vendor/grammars/applescript.tmbundle:
- source.applescript
vendor/grammars/asciidoc.tmbundle:
- text.html.asciidoc
vendor/grammars/asp-syntax-highlight:
- source.answersetprogramming
vendor/grammars/asp.tmbundle:
- source.asp
- text.html.asp
Expand Down Expand Up @@ -900,6 +899,8 @@ vendor/grammars/opa.tmbundle:
- source.opa
vendor/grammars/openscad.tmbundle:
- source.scad
vendor/grammars/overpassql-tmlanguage:
- source.overpassql
vendor/grammars/oz-tmbundle:
- source.oz
vendor/grammars/pact-atom:
Expand Down Expand Up @@ -1141,6 +1142,8 @@ vendor/grammars/vscode-TalonScript:
- source.talon
vendor/grammars/vscode-antlers-language-server:
- text.html.statamic
vendor/grammars/vscode-apache:
- source.apacheconf
vendor/grammars/vscode-bitbake:
- source.bb
vendor/grammars/vscode-brightscript-language:
Expand Down Expand Up @@ -1203,6 +1206,8 @@ vendor/grammars/vscode-jest:
- source.jest.snap
vendor/grammars/vscode-just:
- source.just
vendor/grammars/vscode-kdl:
- source.kdl
vendor/grammars/vscode-lean:
- markdown.lean.codeblock
- source.lean
Expand All @@ -1214,6 +1219,8 @@ vendor/grammars/vscode-lean4:
vendor/grammars/vscode-livecodescript:
- source.lcb
- source.livecodescript
vendor/grammars/vscode-minizinc:
- source.mzn
vendor/grammars/vscode-monkey-c:
- source.mc
vendor/grammars/vscode-motoko:
Expand Down Expand Up @@ -1305,6 +1312,8 @@ vendor/grammars/wollok-sublime:
- source.wollok
vendor/grammars/xc.tmbundle:
- source.xc
vendor/grammars/xmake-lua.tmbundle:
- source.xmake
vendor/grammars/xml.tmbundle:
- text.xml
- text.xml.xsl
Expand Down
15 changes: 12 additions & 3 deletions lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ disambiguations:
pattern: '^import [a-z]'
- language: Lean 4
pattern: '^import [A-Z]'
- extensions: ['.lp']
rules:
- language: Linear Programming
pattern: '^(?i:minimize|minimum|min|maximize|maximum|max)(?i:\s+multi-objectives)?$'
- language: Answer Set Programming
- extensions: ['.ls']
rules:
- language: LoomScript
Expand Down Expand Up @@ -506,8 +511,8 @@ disambiguations:
- language: MAXScript
- extensions: ['.msg']
rules:
- language: omnetpp-msg
pattern: '^cplusplus \{\{|^namespace[\s]*([^.\s]*\.)*[^.\s]*;|^struct \{|^message [\S]* (extends)? [\S]*[\s]*\{|^packet \{|^class (extends) [\S]*[\s]*\{|^enum \{|^import ([^.\s]*\.)*[^.\s]*;'
- language: OMNeT++ MSG
pattern: '^cplusplus\(?[\S]*\)?[\s]*\{?\{?|^namespace[\s]+([^.\s]*\.)*[^.\s]*;|^struct[\s]+[\S]+|^message[\s]+[\S]+(extends )?[\S]*[\s]*|^packet[\s]+[\S]+|^class[\s]+[\S]+(extends )?[\S]*[\s]*|^enum[\s]+[\S]+|^import ([^.\s]*\.)*[^.\s]*;'
- extensions: ['.n']
rules:
- language: Roff
Expand Down Expand Up @@ -749,6 +754,11 @@ disambiguations:
rules:
- language: STL
pattern: '\A\s*solid(?:$|\s)[\s\S]*^endsolid(?:$|\s)'
- extensions: ['.svx']
rules:
- language: Survex data
pattern: '\A(;|\*[^*]+$)'
- language: mdsvex
- extensions: ['.sw']
rules:
- language: Sway
Expand Down Expand Up @@ -939,7 +949,6 @@ named_patterns:
freebasic:
- '(?i)^[ \t]*#(?:define|endif|endmacro|ifn?def|include|lang|macro|pragma)(?:$|\s)'
- '(?i)^[ \t]*dim( shared)? [a-z_][a-z0-9_]* as [a-z_][a-z0-9_]* ptr'
- '(?i)^[ \t]*dim( shared)? as [a-z_][a-z0-9_]* [a-z_][a-z0-9_]*'
gsc:
- '^\s*#\s*(?:using|insert|include|define|namespace)[ \t]+\w'
- '^\s*(?>(?:autoexec|private)\s+){0,2}function\s+(?>(?:autoexec|private)\s+){0,2}\w+\s*\('
Expand Down
Loading

0 comments on commit a6e5cf0

Please sign in to comment.