diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-11-17 17:28:53 -0500 |
|---|---|---|
| committer | Stephan Seitz <stephan.lauf@yahoo.de> | 2020-12-31 14:27:43 +0100 |
| commit | 5236768c3308314f0d4bf2066d4411b2df4d59e3 (patch) | |
| tree | fe2e3ed49a6f4726b98521e208ba5e9bdbcdbe12 | |
| parent | 57ba843d184e30339cff76869a0f5e60a467a047 (diff) | |
add gdscript
| -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 |
