on master help sign in
support for openscad (#2680)

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

commitf0d1c855539cfeb8e66c3602a971857f8c20be0f authorfarwyler <1705805+farwyler@users.noreply.github.com> dateMon 6 Jun 2022, 19:26 (4 years ago) parent26dbdb7
3 files changed+79
book/src/generated/lang-support.md+1 languages.toml+15 runtime/queries/openscad/highlights.scm+63
book/src/generated/lang-support.md+1
@@ -63,6 +63,7 @@
6363| ocaml | ✓ | | ✓ | `ocamllsp` |
6464| ocaml-interface | ✓ | | | `ocamllsp` |
6565| odin | ✓ | | | |
66+| openscad | ✓ | | | `openscad-language-server` |
6667| org | ✓ | | | |
6768| perl | ✓ | ✓ | ✓ | |
6869| php | ✓ | ✓ | ✓ | `intelephense` |
languages.toml+15
@@ -1433,3 +1433,18 @@ indent = { tab-width = 2, unit = " " }
14331433[[grammar]]
14341434name = "jsdoc"
14351435source = { git = "https://github.com/tree-sitter/tree-sitter-jsdoc", rev = "189a6a4829beb9cdbe837260653b4a3dfb0cc3db" }
1436+
1437+
1438+[[language]]
1439+name = "openscad"
1440+scope = "source.openscad"
1441+injection-regex = "openscad"
1442+file-types = ["scad"]
1443+roots = []
1444+comment-token = "//"
1445+language-server = { command = "openscad-language-server" }
1446+indent = { tab-width = 2, unit = "\t" }
1447+
1448+[[grammar]]
1449+name = "openscad"
1450+source = { git = "https://github.com/bollian/tree-sitter-openscad", rev = "5c3ce93df0ac1da7197cf6ae125aade26d6b8972" }
runtime/queries/openscad/highlights.scmnew file+63
@@ -0,0 +1,63 @@
1+(number) @constant.numeric
2+(string) @string
3+(boolean) @constant.builtin.boolean
4+(include_path) @string.special.path
5+
6+(parameters_declaration (identifier) @variable.parameter)
7+(function_declaration name: (identifier) @function)
8+
9+(function_call function: (identifier) @function)
10+(module_call name: (identifier) @function)
11+
12+(identifier) @variable
13+(special_variable) @variable.builtin
14+
15+[
16+ "function"
17+ "let"
18+ "assign"
19+] @keyword
20+
21+[
22+ "for"
23+ "each"
24+ "intersection_for"
25+] @keyword.control.repeat
26+
27+[
28+ "if"
29+] @keyword.control.conditional
30+
31+[
32+ "module"
33+ "use"
34+ "include"
35+] @keyword.control.import
36+
37+[
38+ "||"
39+ "&&"
40+ "=="
41+ "!="
42+ "<"
43+ ">"
44+ "<="
45+ ">="
46+ "+"
47+ "-"
48+ "*"
49+ "/"
50+ "%"
51+ "^"
52+ "?"
53+ "!"
54+ ":"
55+] @operator
56+
57+[
58+ ";"
59+ ","
60+ "."
61+] @punctuation.delimiter
62+
63+(comment) @comment