diff options
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 9 | ||||
| -rw-r--r-- | queries/gdscript/highlights.scm | 27 | ||||
| -rw-r--r-- | queries/gdscript/locals.scm | 10 |
3 files changed, 46 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index bca67dde..701a311d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -389,6 +389,15 @@ list.sparql = { maintainers = { "@bonabeavis" }, } +list.gdscript = { + install_info = { + url = "https://github.com/PrestonKnopp/tree-sitter-gdscript", + files = { "src/parser.c", "src/scanner.cc" }, + }, + readme_name = "Godot (gdscript)", + maintainers = {"not @tjdevries"}, +} + local M = { list = list } diff --git a/queries/gdscript/highlights.scm b/queries/gdscript/highlights.scm new file mode 100644 index 00000000..06b7c8df --- /dev/null +++ b/queries/gdscript/highlights.scm @@ -0,0 +1,27 @@ +(identifier) @variable + +(name) @variable +(type) @type +(comment) @comment + +(enum_definition + (name) @constant) @Statement + +(function_definition + (name) @function + (parameters + (identifier)* @parameter) @punctuation.bracket) @Statement + +(return_statement) @Statement + +(variable_statement + (inferred_type)? @operator) @Statement + +(call (identifier) @function) @punctuation.bracket +(attribute (attribute_call (identifier) @function) @punctuation.bracket) + +; simple items +[ (binary_operator) (comparison_operator) ] @operator +[ (false) (true) ] @boolean +(string) @string +(integer) @number diff --git a/queries/gdscript/locals.scm b/queries/gdscript/locals.scm new file mode 100644 index 00000000..313af2ae --- /dev/null +++ b/queries/gdscript/locals.scm @@ -0,0 +1,10 @@ +(function_definition) @definition.function + +[ + (extends_statement) + (variable_statement) + (expression_statement) + (if_statement) + (function_definition) + (body) +] @scope |
