From 6c0786edc575c5b70bd0d5dcbdaf083f8b5525b1 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Mon, 11 Oct 2021 20:31:47 -0500 Subject: prefer elixir-lang/tree-sitter-elixir --- helix-syntax/languages/tree-sitter-elixir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-syntax/languages') diff --git a/helix-syntax/languages/tree-sitter-elixir b/helix-syntax/languages/tree-sitter-elixir index 295e62a4..7ae20df1 160000 --- a/helix-syntax/languages/tree-sitter-elixir +++ b/helix-syntax/languages/tree-sitter-elixir @@ -1 +1 @@ -Subproject commit 295e62a43b92cea909cfabe57e8818d177f4857b +Subproject commit 7ae20df181b86c79d826abd5aec7a3e32e3d8438 -- cgit v1.2.3-70-g09d2 From 8f658f0dceffa7bcf2ea18cd6fd0a7dab4e37663 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 14 Oct 2021 13:46:58 -0500 Subject: use latest tree-sitter-elixir with 'not in' query support connects https://github.com/elixir-lang/tree-sitter-elixir/issues/9 --- helix-syntax/languages/tree-sitter-elixir | 2 +- runtime/queries/elixir/highlights.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-syntax/languages') diff --git a/helix-syntax/languages/tree-sitter-elixir b/helix-syntax/languages/tree-sitter-elixir index 7ae20df1..f5d7bda5 160000 --- a/helix-syntax/languages/tree-sitter-elixir +++ b/helix-syntax/languages/tree-sitter-elixir @@ -1 +1 @@ -Subproject commit 7ae20df181b86c79d826abd5aec7a3e32e3d8438 +Subproject commit f5d7bda543da788bd507b05bd722627dde66c9ec diff --git a/runtime/queries/elixir/highlights.scm b/runtime/queries/elixir/highlights.scm index 82ef081d..33a84ace 100644 --- a/runtime/queries/elixir/highlights.scm +++ b/runtime/queries/elixir/highlights.scm @@ -17,7 +17,7 @@ ; Reserved keywords -["when" "and" "or" "not" "in" "fn" "do" "end" "catch" "rescue" "after" "else"] @keyword +["when" "and" "or" "not" "in" "not in" "fn" "do" "end" "catch" "rescue" "after" "else"] @keyword ; Operators -- cgit v1.2.3-70-g09d2 From 787ba4f233a38e42cfeab5c5125122d7d7b85e8f Mon Sep 17 00:00:00 2001 From: ath3 Date: Sat, 23 Oct 2021 01:57:21 +0200 Subject: CMake support (#888) --- .gitmodules | 4 ++ helix-syntax/languages/tree-sitter-cmake | 1 + languages.toml | 8 +++ runtime/queries/cmake/highlights.scm | 97 ++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 160000 helix-syntax/languages/tree-sitter-cmake create mode 100644 runtime/queries/cmake/highlights.scm (limited to 'helix-syntax/languages') diff --git a/.gitmodules b/.gitmodules index 01260b84..7ed34ad3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -130,3 +130,7 @@ path = helix-syntax/languages/tree-sitter-tsq url = https://github.com/tree-sitter/tree-sitter-tsq shallow = true +[submodule "helix-syntax/languages/tree-sitter-cmake"] + path = helix-syntax/languages/tree-sitter-cmake + url = https://github.com/uyha/tree-sitter-cmake + shallow = true diff --git a/helix-syntax/languages/tree-sitter-cmake b/helix-syntax/languages/tree-sitter-cmake new file mode 160000 index 00000000..f6616f1e --- /dev/null +++ b/helix-syntax/languages/tree-sitter-cmake @@ -0,0 +1 @@ +Subproject commit f6616f1e417ee8b62daf251aa1daa5d73781c596 diff --git a/languages.toml b/languages.toml index 67f4d3d6..a393b4a6 100644 --- a/languages.toml +++ b/languages.toml @@ -346,3 +346,11 @@ file-types = ["scm"] roots = [] comment-token = ";" indent = { tab-width = 2, unit = " " } + +[[language]] +name = "cmake" +scope = "source.cmake" +file-types = ["cmake", "CMakeLists.txt"] +roots = [] +comment-token = "#" +indent = { tab-width = 2, unit = " " } diff --git a/runtime/queries/cmake/highlights.scm b/runtime/queries/cmake/highlights.scm new file mode 100644 index 00000000..71e9b5d9 --- /dev/null +++ b/runtime/queries/cmake/highlights.scm @@ -0,0 +1,97 @@ +[ + (quoted_argument) + (bracket_argument) + ] @string + +(variable) @variable + +[ + (bracket_comment) + (line_comment) + ] @comment + +(normal_command (identifier) @function) + +["ENV" "CACHE"] @string.special.symbol +["$" "{" "}" "<" ">"] @punctuation +["(" ")"] @punctuation.bracket + +[ + (function) + (endfunction) + (macro) + (endmacro) + ] @keyword.function + +[ + (if) + (elseif) + (else) + (endif) + ] @keyword.control.conditional + +[ + (foreach) + (endforeach) + (while) + (endwhile) + ] @keyword.control.repeat + +(function_command + (function) + . (argument) @function + (argument)* @variable.parameter + ) + +(macro_command + (macro) + . (argument) @function.macro + (argument)* @variable.parameter + ) + +(normal_command + (identifier) @function.builtin + . (argument) @variable + (#match? @function.builtin "^(?i)(set)$")) + +(normal_command + (identifier) @function.builtin + . (argument) + (argument) @constant + (#match? @constant "^(?:PARENT_SCOPE|CACHE)$") + (#match? @function.builtin "^(?i)(unset)$")) + +(normal_command + (identifier) @function.builtin + . (argument) + . (argument) + (argument) @constant + (#match? @constant "^(?:PARENT_SCOPE|CACHE|FORCE)$") + (#match? @function.builtin "^(?i)(set)$") + ) + +((argument) @constant.builtin.boolean + (#match? @constant.builtin.boolean "^(?i)(?:1|on|yes|true|y|0|off|no|false|n|ignore|notfound|.*-notfound)$") + ) + +(if_command + (if) + (argument) @operator + (#match? @operator "^(?:NOT|AND|OR|COMMAND|POLICY|TARGET|TEST|DEFINED|IN_LIST|EXISTS|IS_NEWER_THAN|IS_DIRECTORY|IS_SYMLINK|IS_ABSOLUTE|MATCHES|LESS|GREATER|EQUAL|LESS_EQUAL|GREATER_EQUAL|STRLESS|STRGREATER|STREQUAL|STRLESS_EQUAL|STRGREATER_EQUAL|VERSION_LESS|VERSION_GREATER|VERSION_EQUAL|VERSION_LESS_EQUAL|VERSION_GREATER_EQUAL)$") +) + +(normal_command + (identifier) @function.builtin + . (argument) + (argument) @constant + (#match? @constant "^(?:ALL|COMMAND|DEPENDS|BYPRODUCTS|WORKING_DIRECTORY|COMMENT|JOB_POOL|VERBATIM|USES_TERMINAL|COMMAND_EXPAND_LISTS|SOURCES)$") + (#match? @function.builtin "^(?i)(add_custom_target)$") + ) + +(normal_command + (identifier) @function.builtin + (argument) @constant + (#match? @constant "^(?:OUTPUT|COMMAND|MAIN_DEPENDENCY|DEPENDS|BYPRODUCTS|IMPLICIT_DEPENDS|WORKING_DIRECTORY|COMMENT|DEPFILE|JOB_POOL|VERBATIM|APPEND|USES_TERMINAL|COMMAND_EXPAND_LISTS)$") + (#match? @function.builtin "^(?i)(add_custom_command)$") + ) + -- cgit v1.2.3-70-g09d2 From a1c7e55e3be95be6769d3a08518c8a41c257016f Mon Sep 17 00:00:00 2001 From: Houkime Date: Fri, 29 Oct 2021 05:11:19 +0000 Subject: update cpp queries (#930) Co-authored-by: Houkime <>--- helix-syntax/languages/tree-sitter-cpp | 2 +- runtime/queries/cpp/highlights.scm | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'helix-syntax/languages') diff --git a/helix-syntax/languages/tree-sitter-cpp b/helix-syntax/languages/tree-sitter-cpp index c6121241..e8dcc9d2 160000 --- a/helix-syntax/languages/tree-sitter-cpp +++ b/helix-syntax/languages/tree-sitter-cpp @@ -1 +1 @@ -Subproject commit c61212414a3e95b5f7507f98e83de1d638044adc +Subproject commit e8dcc9d2b404c542fd236ea5f7208f90be8a6e89 diff --git a/runtime/queries/cpp/highlights.scm b/runtime/queries/cpp/highlights.scm index 3315fde0..3348ef3c 100644 --- a/runtime/queries/cpp/highlights.scm +++ b/runtime/queries/cpp/highlights.scm @@ -3,7 +3,7 @@ ; Functions (call_expression - function: (scoped_identifier + function: (qualified_identifier name: (identifier) @function)) (template_function @@ -13,15 +13,14 @@ name: (field_identifier) @function) (template_function - name: (scoped_identifier - name: (identifier) @function)) + name: (identifier) @function) (function_declarator - declarator: (scoped_identifier + declarator: (qualified_identifier name: (identifier) @function)) (function_declarator - declarator: (scoped_identifier + declarator: (qualified_identifier name: (identifier) @function)) (function_declarator -- cgit v1.2.3-70-g09d2