update highlight.scm and add tags.scm

This commit is contained in:
paul committed 2026-10-24 17:26:25 -04:00
1 parent 2204d58102
commit 920f745b6b
4 files changed
+37 -18

No files matched your search

+1 -1
View File
@@ -26,6 +26,6 @@
"generate": "tree-sitter generate",
"test": "tree-sitter test",
"test:fixtures": "sh ./scripts/check-fixtures.sh",
"test:queries": "tree-sitter query -p . --quiet queries/highlights.scm test/fixtures/valid/*.ls"
"test:queries": "tree-sitter query -p . --quiet queries/highlights.scm test/fixtures/valid/*.ls && tree-sitter query -p . --quiet queries/tags.scm test/fixtures/valid/*.ls"
}
}
+28 -16
View File
@@ -18,33 +18,45 @@
"use"
] @keyword
(primitive_type) @type.builtin
(identifier) @variable
(comment) @comment
(default_expression) @keyword
(boolean_literal) @constant.builtin
(string_literal) @string
(character_literal) @character
(integer_literal) @number
(float_literal) @number.float
(label (identifier) @label)
(boolean_literal) @constant.builtin
(default_expression) @keyword
(declaration name: (identifier) @variable.definition)
(typed_parameter pattern: (identifier) @variable.parameter)
(typed_tuple_component pattern: (identifier) @variable.parameter)
(product_field name: (identifier) @property)
(product_entry (identifier) @property)
(sum_variant name: (identifier) @constructor)
(sum_constructor variant: (identifier) @constructor)
(sum_pattern variant: (identifier) @constructor)
(bits_member (identifier) @constant)
(primitive_type) @type.builtin
(type_name) @type
(binder_entry type: (identifier) @type)
(module_path) @module
(declaration name: (identifier) @function value: (function_literal))
(declaration name: (identifier) @function type: (function_type))
(declaration name: (identifier) @type.definition value: (type_definition))
(pipeline_callable (identifier) @function.call .)
(aggregate_pipeline_callable (identifier) @function.call .)
(constraint_entry name: (identifier) @function)
(output_type function: (identifier) @function)
(output_type function: (qualified_name (identifier) @function .))
(postfix_expression member: (identifier) @variable.member)
(product_constructor (type_name) @type)
(sum_constructor variant: (identifier) @constructor)
(sum_pattern variant: (identifier) @constructor)
(label (identifier) @label)
(typed_parameter pattern: (identifier) @variable.parameter)
(typed_tuple_component pattern: (identifier) @variable.parameter)
(product_field name: (identifier) @variable.member)
(product_entry (identifier) @property)
(sum_variant name: (identifier) @constructor)
(bits_member (identifier) @constant)
[
"=" "+=" "-=" "*=" "/=" "%=" "&=" "^=" "|="
"=" "+=" "-=" "*=" "/=" "%=" "&=" "^=" "|=" "::" ":="
"==" "<" "<=" ">" ">="
"+" "-" "*" "/" "%" "&" "|" "^" "~"
"->" "=>" "|>" "..<" "..=" "@"
"->" "=>" "|>" "..<" "..=" "@" "?" "..."
] @operator
["(" ")" "[" "]" "{" "}" ":" ";" "," "."] @punctuation
+5
View File
@@ -0,0 +1,5 @@
; The picker resolves overlapping definitions in favor of function/type tags.
(declaration name: (identifier) @name) @definition.variable
(declaration name: (identifier) @name value: (function_literal)) @definition.function
(declaration name: (identifier) @name type: (function_type)) @definition.function
(declaration name: (identifier) @name value: (type_definition)) @definition.type
+3 -1
View File
@@ -6,8 +6,10 @@
"scope": "source.lscript",
"path": ".",
"file-types": [
"ls"
"ls",
"lscript"
],
"tags": "queries/tags.scm",
"highlights": "queries/highlights.scm"
}
],