Skip to content

Commit

Permalink
support for openscad (#2680)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
  • Loading branch information
farwyler and the-mikedavis authored Jun 6, 2022
1 parent 26dbdb7 commit f0d1c85
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
| ocaml || || `ocamllsp` |
| ocaml-interface || | | `ocamllsp` |
| odin || | | |
| openscad || | | `openscad-language-server` |
| org || | | |
| perl |||| |
| php |||| `intelephense` |
Expand Down
15 changes: 15 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1433,3 +1433,18 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "jsdoc"
source = { git = "https://github.com/tree-sitter/tree-sitter-jsdoc", rev = "189a6a4829beb9cdbe837260653b4a3dfb0cc3db" }


[[language]]
name = "openscad"
scope = "source.openscad"
injection-regex = "openscad"
file-types = ["scad"]
roots = []
comment-token = "//"
language-server = { command = "openscad-language-server" }
indent = { tab-width = 2, unit = "\t" }

[[grammar]]
name = "openscad"
source = { git = "https://github.com/bollian/tree-sitter-openscad", rev = "5c3ce93df0ac1da7197cf6ae125aade26d6b8972" }
63 changes: 63 additions & 0 deletions runtime/queries/openscad/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
(number) @constant.numeric
(string) @string
(boolean) @constant.builtin.boolean
(include_path) @string.special.path

(parameters_declaration (identifier) @variable.parameter)
(function_declaration name: (identifier) @function)

(function_call function: (identifier) @function)
(module_call name: (identifier) @function)

(identifier) @variable
(special_variable) @variable.builtin

[
"function"
"let"
"assign"
] @keyword

[
"for"
"each"
"intersection_for"
] @keyword.control.repeat

[
"if"
] @keyword.control.conditional

[
"module"
"use"
"include"
] @keyword.control.import

[
"||"
"&&"
"=="
"!="
"<"
">"
"<="
">="
"+"
"-"
"*"
"/"
"%"
"^"
"?"
"!"
":"
] @operator

[
";"
","
"."
] @punctuation.delimiter

(comment) @comment

0 comments on commit f0d1c85

Please sign in to comment.