Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
novusnota committed Jun 25, 2024
2 parents beebdbe + 39fd5e9 commit 0f21761
Show file tree
Hide file tree
Showing 262 changed files with 8,080 additions and 282 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"vscode": {
"extensions": [
"EditorConfig.EditorConfig",
"rebornix.Ruby",
"redhat.vscode-yaml"
"redhat.vscode-yaml",
"Shopify.ruby-lsp"
]
}
},
Expand Down
58 changes: 53 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
[submodule "vendor/grammars/LiveScript.tmbundle"]
path = vendor/grammars/LiveScript.tmbundle
url = https://github.com/paulmillr/LiveScript.tmbundle
[submodule "vendor/grammars/Luau.tmLanguage"]
path = vendor/grammars/Luau.tmLanguage
url = https://github.com/JohnnyMorganz/Luau.tmLanguage.git
[submodule "vendor/grammars/MATLAB-Language-grammar"]
path = vendor/grammars/MATLAB-Language-grammar
url = https://github.com/mathworks/MATLAB-Language-grammar
Expand Down Expand Up @@ -188,9 +191,6 @@
[submodule "vendor/grammars/TXL"]
path = vendor/grammars/TXL
url = https://github.com/MikeHoffert/Sublime-Text-TXL-syntax
[submodule "vendor/grammars/Terraform.tmLanguage"]
path = vendor/grammars/Terraform.tmLanguage
url = https://github.com/alexlouden/Terraform.tmLanguage
[submodule "vendor/grammars/Textmate-Gosu-Bundle"]
path = vendor/grammars/Textmate-Gosu-Bundle
url = https://github.com/jpcamara/Textmate-Gosu-Bundle
Expand Down Expand Up @@ -353,6 +353,9 @@
[submodule "vendor/grammars/boogie-vscode"]
path = vendor/grammars/boogie-vscode
url = https://github.com/boogie-org/boogie-vscode
[submodule "vendor/grammars/bqn-vscode"]
path = vendor/grammars/bqn-vscode
url = https://github.com/razetime/bqn-vscode.git
[submodule "vendor/grammars/browserslist-vscode"]
path = vendor/grammars/browserslist-vscode
url = https://github.com/browserslist/browserslist-vscode
Expand Down Expand Up @@ -383,6 +386,9 @@
[submodule "vendor/grammars/cmake.tmbundle"]
path = vendor/grammars/cmake.tmbundle
url = https://github.com/textmate/cmake.tmbundle
[submodule "vendor/grammars/common-lisp-tmlanguage"]
path = vendor/grammars/common-lisp-tmlanguage
url = https://github.com/qingpeng9802/common-lisp-tmlanguage.git
[submodule "vendor/grammars/conllu-linguist-grammar"]
path = vendor/grammars/conllu-linguist-grammar
url = https://github.com/odanoburu/conllu-linguist-grammar
Expand All @@ -395,6 +401,9 @@
[submodule "vendor/grammars/creole"]
path = vendor/grammars/creole
url = https://github.com/Siddley/Creole
[submodule "vendor/grammars/cron.tmbundle"]
path = vendor/grammars/cron.tmbundle
url = https://github.com/textmate/cron.tmbundle
[submodule "vendor/grammars/csharp-tmLanguage"]
path = vendor/grammars/csharp-tmLanguage
url = https://github.com/dotnet/csharp-tmLanguage
Expand Down Expand Up @@ -440,6 +449,9 @@
[submodule "vendor/grammars/ecl-tmLanguage"]
path = vendor/grammars/ecl-tmLanguage
url = https://github.com/hpcc-systems/ecl-tmLanguage
[submodule "vendor/grammars/edge-vscode"]
path = vendor/grammars/edge-vscode
url = https://github.com/edge-js/edge-vscode.git
[submodule "vendor/grammars/edgedb-editor-plugin"]
path = vendor/grammars/edgedb-editor-plugin
url = https://github.com/edgedb/edgedb-editor-plugin.git
Expand All @@ -464,6 +476,9 @@
[submodule "vendor/grammars/fancy-tmbundle"]
path = vendor/grammars/fancy-tmbundle
url = https://github.com/fancy-lang/fancy-tmbundle
[submodule "vendor/grammars/firrtl-syntax"]
path = vendor/grammars/firrtl-syntax
url = https://github.com/chipsalliance/firrtl-syntax.git
[submodule "vendor/grammars/fish-tmbundle"]
path = vendor/grammars/fish-tmbundle
url = https://github.com/l15n/fish-tmbundle
Expand Down Expand Up @@ -590,6 +605,9 @@
[submodule "vendor/grammars/language-batchfile"]
path = vendor/grammars/language-batchfile
url = https://github.com/mmims/language-batchfile
[submodule "vendor/grammars/language-bh"]
path = vendor/grammars/language-bh
url = https://github.com/B-Lang-org/language-bh.git
[submodule "vendor/grammars/language-blade"]
path = vendor/grammars/language-blade
url = https://github.com/jawee/language-blade
Expand Down Expand Up @@ -797,6 +815,9 @@
[submodule "vendor/grammars/language-texinfo"]
path = vendor/grammars/language-texinfo
url = https://github.com/Alhadis/language-texinfo
[submodule "vendor/grammars/language-ti-basic"]
path = vendor/grammars/language-ti-basic
url = https://github.com/TIny-Hacker/language-ti-basic.git
[submodule "vendor/grammars/language-toc-wow"]
path = vendor/grammars/language-toc-wow
url = https://github.com/nebularg/language-toc-wow
Expand Down Expand Up @@ -853,7 +874,7 @@
url = https://github.com/textmate/logtalk.tmbundle
[submodule "vendor/grammars/lua.tmbundle"]
path = vendor/grammars/lua.tmbundle
url = https://github.com/textmate/lua.tmbundle
url = https://github.com/LuaLS/lua.tmbundle.git
[submodule "vendor/grammars/m3"]
path = vendor/grammars/m3
url = https://github.com/newgrammars/m3
Expand Down Expand Up @@ -887,6 +908,9 @@
[submodule "vendor/grammars/mlir-grammar"]
path = vendor/grammars/mlir-grammar
url = https://github.com/jpienaar/mlir-grammar
[submodule "vendor/grammars/mojo-syntax"]
path = vendor/grammars/mojo-syntax
url = https://github.com/modularml/mojo-syntax.git
[submodule "vendor/grammars/monkey"]
path = vendor/grammars/monkey
url = https://github.com/gingerbeardman/monkey.tmbundle
Expand Down Expand Up @@ -953,6 +977,9 @@
[submodule "vendor/grammars/pike-textmate"]
path = vendor/grammars/pike-textmate
url = https://github.com/hww3/pike-textmate
[submodule "vendor/grammars/pkl.tmbundle"]
path = vendor/grammars/pkl.tmbundle
url = https://github.com/apple/pkl.tmbundle.git
[submodule "vendor/grammars/polar-grammar"]
path = vendor/grammars/polar-grammar
url = https://github.com/osohq/polar-grammar.git
Expand Down Expand Up @@ -995,6 +1022,9 @@
[submodule "vendor/grammars/riot-syntax-highlight"]
path = vendor/grammars/riot-syntax-highlight
url = https://github.com/riot/syntax-highlight
[submodule "vendor/grammars/roc-vscode-unofficial"]
path = vendor/grammars/roc-vscode-unofficial
url = https://github.com/ivan-demchenko/roc-vscode-unofficial.git
[submodule "vendor/grammars/ruby-slim.tmbundle"]
path = vendor/grammars/ruby-slim.tmbundle
url = https://github.com/slim-template/ruby-slim.tmbundle
Expand All @@ -1019,6 +1049,9 @@
[submodule "vendor/grammars/shaders-tmLanguage"]
path = vendor/grammars/shaders-tmLanguage
url = https://github.com/tgjones/shaders-tmLanguage
[submodule "vendor/grammars/slint-tmLanguage"]
path = vendor/grammars/slint-tmLanguage
url = https://github.com/slint-ui/slint-tmLanguage.git
[submodule "vendor/grammars/smali-sublime"]
path = vendor/grammars/smali-sublime
url = https://github.com/ShaneWilton/sublime-smali
Expand All @@ -1030,7 +1063,7 @@
url = https://github.com/awslabs/smithy-vscode.git
[submodule "vendor/grammars/sourcepawn-vscode"]
path = vendor/grammars/sourcepawn-vscode
url = https://github.com/Dreae/sourcepawn-vscode
url = https://github.com/Sarrus1/sourcepawn-vscode.git
[submodule "vendor/grammars/sql.tmbundle"]
path = vendor/grammars/sql.tmbundle
url = https://github.com/textmate/sql.tmbundle
Expand Down Expand Up @@ -1169,6 +1202,9 @@
[submodule "vendor/grammars/tcl.tmbundle"]
path = vendor/grammars/tcl.tmbundle
url = https://github.com/textmate/tcl.tmbundle
[submodule "vendor/grammars/templ-vscode"]
path = vendor/grammars/templ-vscode
url = https://github.com/templ-go/templ-vscode.git
[submodule "vendor/grammars/textmate.tmbundle"]
path = vendor/grammars/textmate.tmbundle
url = https://github.com/textmate/textmate.tmbundle
Expand Down Expand Up @@ -1208,9 +1244,15 @@
[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-bitbake"]
path = vendor/grammars/vscode-bitbake
url = https://github.com/yoctoproject/vscode-bitbake.git
[submodule "vendor/grammars/vscode-brightscript-language"]
path = vendor/grammars/vscode-brightscript-language
url = https://github.com/rokucommunity/vscode-brightscript-language.git
[submodule "vendor/grammars/vscode-caddyfile"]
path = vendor/grammars/vscode-caddyfile
url = https://github.com/caddyserver/vscode-caddyfile.git
[submodule "vendor/grammars/vscode-cadence"]
path = vendor/grammars/vscode-cadence
url = https://github.com/onflow/vscode-cadence.git
Expand Down Expand Up @@ -1293,9 +1335,15 @@
[submodule "vendor/grammars/vscode-proto3"]
path = vendor/grammars/vscode-proto3
url = https://github.com/zxh0/vscode-proto3
[submodule "vendor/grammars/vscode-python"]
path = vendor/grammars/vscode-python
url = https://github.com/microsoft/vscode-python.git
[submodule "vendor/grammars/vscode-rbs-syntax"]
path = vendor/grammars/vscode-rbs-syntax
url = https://github.com/soutaro/vscode-rbs-syntax.git
[submodule "vendor/grammars/vscode-ron"]
path = vendor/grammars/vscode-ron
url = https://github.com/a5huynh/vscode-ron.git
[submodule "vendor/grammars/vscode-scala-syntax"]
path = vendor/grammars/vscode-scala-syntax
url = https://github.com/scala/vscode-scala-syntax
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ If you can, try to reproduce the highlighting problem in the text editor that th
You can also try to fix the bug yourself and submit a pull-request.
[TextMate's documentation](https://manual.macromates.com/en/language_grammars) offers a good introduction on how to work with TextMate-compatible grammars.
Note that Linguist uses [PCRE](https://www.pcre.org/) regular expressions, while TextMate uses [Oniguruma](https://github.com/kkos/oniguruma).
Although they are mostly compatible there might be some differences in syntax and semantics between the two.
Although they are mostly compatible, there may be occasional differences in syntax and semantics between the two.
Linguist's grammar compiler will highlight any problems when the grammar is updated.

Once the bug has been fixed upstream, we'll pick it up for GitHub in the next release of Linguist.
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
# The error count will need to be adjusted here until such time as all grammars are 100% error free.
desc "Check that compiling the grammars doesn't introduce any new unexpected errors"
task :check_grammars do
expected_error_count = 36 # This count should only ever go down. If it goes up, there's a new issue that needs to be addressed before updating the grammar.
expected_error_count = 41 # This count should only ever go down. If it goes up, there's a new issue that needs to be addressed before updating the grammar.
rm_rf "linguist-grammars"
output, status = Open3.capture2e("script/grammar-compiler", "compile", "-o", "linguist-grammars")
errors_found = output[/The grammar library contains ([0-9]+) errors/, 1].to_i
Expand Down
10 changes: 7 additions & 3 deletions bin/git-linguist
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ require 'tempfile'
require 'zlib'

class GitLinguist
def initialize(path, commit_oid, incremental = true)
def initialize(path, commit_oid, incremental = true, tree_size = Linguist::Repository.MAX_TREE_SIZE)
@repo_path = path
@commit_oid = commit_oid
@incremental = incremental
@tree_size = tree_size
end

def linguist
if @commit_oid.nil?
raise "git-linguist must be called with a specific commit OID to perform language computation"
end
repo = Linguist::Repository.new(rugged, @commit_oid)
repo = Linguist::Repository.new(rugged, @commit_oid, @tree_size)

if @incremental && stats = load_language_stats
old_commit_oid, old_stats = stats
Expand Down Expand Up @@ -98,6 +99,7 @@ end
def git_linguist(args)
incremental = true
commit = nil
tree_size = Linguist::Repository::MAX_TREE_SIZE

parser = OptionParser.new do |opts|
opts.banner = <<~HELP
Expand All @@ -110,12 +112,14 @@ def git_linguist(args)

opts.on("-f", "--force", "Force a full rescan") { incremental = false }
opts.on("-c", "--commit=COMMIT", "Commit to index") { |v| commit = v}
opts.on("-t", "--tree-size=NUMBER", Integer,
"Maximum number of files scanned to detect languages (default: #{Linguist::Repository::MAX_TREE_SIZE})" ) { |t| tree_size = t }
end

parser.parse!(args)
git_dir = `git rev-parse --git-dir`.strip
raise "git-linguist must be run in a Git repository" unless $?.success?
wrapper = GitLinguist.new(git_dir, commit, incremental)
wrapper = GitLinguist.new(git_dir, commit, incremental, tree_size)

case args.pop
when "stats"
Expand Down
9 changes: 6 additions & 3 deletions bin/github-linguist
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ Linguist v#{Linguist::VERSION}
Detect language type and determine language breakdown for a given Git repository.
Usage: linguist <path>
linguist <path> [--rev REV] [--breakdown] [--json]
linguist [--rev REV] [--breakdown] [--json]
linguist <path> [--rev REV] [--tree-size] [--breakdown] [--json]
linguist [--rev REV] [--tree-size] [--breakdown] [--json]
HELP

def github_linguist(args)
breakdown = false
json_output = false
tree_size = Linguist::Repository::MAX_TREE_SIZE
rev = 'HEAD'
path = Dir.pwd

Expand All @@ -32,6 +33,8 @@ def github_linguist(args)
opts.on("-r", "--rev REV", String,
"Analyze specific git revision",
"defaults to HEAD, see gitrevisions(1) for alternatives") { |r| rev = r }
opts.on("-t", "--tree-size=NUMBER", Integer,
"Maximum number of files scanned to detect languages (default: #{Linguist::Repository::MAX_TREE_SIZE})") { |t| tree_size = t }
opts.on("-h", "--help", "Display a short usage summary, then exit") do
puts opts
exit
Expand All @@ -56,7 +59,7 @@ def github_linguist(args)
puts "invalid revision '#{rev}' for repo '#{path}'"
exit 1
end
repo = Linguist::Repository.new(rugged, target_oid)
repo = Linguist::Repository.new(rugged, target_oid, tree_size)

full_results = {}
repo.languages.each do |language, size|
Expand Down
Loading

0 comments on commit 0f21761

Please sign in to comment.