on master help sign in
Crystal language support (#4993)
aecb524Jonas Everaert
book/src/generated/lang-support.md+1
@@ -16,6 +16,7 @@
16| common-lisp | ✓ | | | `cl-lsp` |
16| common-lisp | ✓ | | | `cl-lsp` |
17| cpon | ✓ | | ✓ | |
17| cpon | ✓ | | ✓ | |
18| cpp | ✓ | ✓ | ✓ | `clangd` |
18| cpp | ✓ | ✓ | ✓ | `clangd` |
19+| crystal | ✓ | | | |
19| css | ✓ | | | `vscode-css-language-server` |
20| css | ✓ | | | `vscode-css-language-server` |
20| cue | ✓ | | | `cuelsp` |
21| cue | ✓ | | | `cuelsp` |
21| d | ✓ | ✓ | ✓ | `serve-d` |
22| d | ✓ | ✓ | ✓ | `serve-d` |
languages.toml+12
@@ -223,6 +223,18 @@ args = { console = "internalConsole", attachCommands = [ "platform select remote
223name = "cpp"
223name = "cpp"
224source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "d5e90fba898f320db48d81ddedd78d52c67c1fed" }
224source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "d5e90fba898f320db48d81ddedd78d52c67c1fed" }
225
225
226+[[language]]
227+name = "crystal"
228+scope = "source.cr"
229+file-types = ["cr"]
230+roots = ["shard.yml", "shard.lock"]
231+comment-token = "#"
232+indent = { tab-width = 2, unit = " " }
233+
234+[[grammar]]
235+name = "crystal"
236+source = { git = "https://github.com/will/tree-sitter-crystal", rev = "15597b307b18028b04d288561f9c29794621562b" }
237+
226[[language]]
238[[language]]
227name = "c-sharp"
239name = "c-sharp"
228scope = "source.csharp"
240scope = "source.csharp"
runtime/queries/crystal/highlights.scmnew file+66
@@ -0,0 +1,66 @@
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+