on master help sign in
Use tree-sitter-ruby for crystal (#5205)
commitb368df57855c77be5f3ae6601f5a83b586feb7c3 authorMichael Davis <mcarsondavis@gmail.com> dateSun 8 Jan 2023, 12:12 (4 years ago) parentec63938
6 files changed+6−71
book/src/generated/lang-support.md+1−1 languages.toml+1−4 runtime/queries/crystal/highlights.scm+1−66 runtime/queries/crystal/injections.scm+1 runtime/queries/crystal/locals.scm+1 runtime/queries/crystal/textobjects.scm+1
book/src/generated/lang-support.md+1−1
@@ -16,7 +16,7 @@
1616| common-lisp | ✓ | | | `cl-lsp` |
1717| cpon | ✓ | | ✓ | |
1818| cpp | ✓ | ✓ | ✓ | `clangd` |
19−| crystal | ✓ | | | |
19+| crystal | ✓ | ✓ | | |
2020| css | ✓ | | | `vscode-css-language-server` |
2121| cue | ✓ | | | `cuelsp` |
2222| d | ✓ | ✓ | ✓ | `serve-d` |
languages.toml+1−4
@@ -230,10 +230,7 @@ file-types = ["cr"]
230230roots = ["shard.yml", "shard.lock"]
231231comment-token = "#"
232232indent = { tab-width = 2, unit = " " }
233−
234−[[grammar]]
235−name = "crystal"
236−source = { git = "https://github.com/will/tree-sitter-crystal", rev = "15597b307b18028b04d288561f9c29794621562b" }
233+grammar = "ruby"
237234
238235[[language]]
239236name = "c-sharp"
runtime/queries/crystal/highlights.scm+1−66
@@ -1,66 +1 @@
1−[
2− "class"
3− "struct"
4− "module"
5−
6− "def"
7− "alias"
8− "do"
9− "end"
10−
11− "require"
12− "include"
13− "extend"
14−] @keyword
15−
16−[
17− "[" "]"
18− "(" ")"
19− "{" "}"
20−] @punctuation.bracket
21−
22−(operator) @operator
23−
24−(comment) @comment
25−
26−; literals
27−
28−(nil) @constant.builtin
29−(bool) @constant.builtin.boolean
30−
31−(integer) @constant.numeric.integer
32−(float) @constant.numeric.float
33−
34−[
35− (string)
36− (char)
37− (commandLiteral)
38−] @string
39−
40−(symbol) @string.special.symbol
41−
42−(regex) @string.special.regex
43−
44−; variables
45−
46−(local_variable) @variable
47−
48−[
49− (instance_variable)
50− (class_variable)
51−] @variable.other.member
52−
53−(constant) @constant
54−
55−; type defintitions
56−
57−(type_identifier) @constructor
58−
59−; method definition/call
60−(identifier) @function.method
61−
62−; types
63−(generic_type) @type
64−(union_type) @type
65−(type_identifier) @type
66−
1+; inherits: ruby
runtime/queries/crystal/injections.scmnew file+1
@@ -0,0 +1 @@
1+; inherits: ruby
runtime/queries/crystal/locals.scmnew file+1
@@ -0,0 +1 @@
1+; inherits: ruby
runtime/queries/crystal/textobjects.scmnew file+1
@@ -0,0 +1 @@
1+; inherits: ruby