update highlight.scm and add tags.scm
This commit is contained in:
1 parent
2204d58102
commit
920f745b6b
4 files changed
+37
-18
No files matched your search
+1
-1
@@ -26,6 +26,6 @@
|
|||||||
"generate": "tree-sitter generate",
|
"generate": "tree-sitter generate",
|
||||||
"test": "tree-sitter test",
|
"test": "tree-sitter test",
|
||||||
"test:fixtures": "sh ./scripts/check-fixtures.sh",
|
"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
@@ -18,33 +18,45 @@
|
|||||||
"use"
|
"use"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
(primitive_type) @type.builtin
|
|
||||||
(identifier) @variable
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
(default_expression) @keyword
|
|
||||||
(boolean_literal) @constant.builtin
|
|
||||||
(string_literal) @string
|
(string_literal) @string
|
||||||
(character_literal) @character
|
(character_literal) @character
|
||||||
(integer_literal) @number
|
(integer_literal) @number
|
||||||
(float_literal) @number.float
|
(float_literal) @number.float
|
||||||
(label (identifier) @label)
|
(boolean_literal) @constant.builtin
|
||||||
|
(default_expression) @keyword
|
||||||
|
|
||||||
(declaration name: (identifier) @variable.definition)
|
(primitive_type) @type.builtin
|
||||||
(typed_parameter pattern: (identifier) @variable.parameter)
|
(type_name) @type
|
||||||
(typed_tuple_component pattern: (identifier) @variable.parameter)
|
(binder_entry type: (identifier) @type)
|
||||||
(product_field name: (identifier) @property)
|
(module_path) @module
|
||||||
(product_entry (identifier) @property)
|
|
||||||
(sum_variant name: (identifier) @constructor)
|
(declaration name: (identifier) @function value: (function_literal))
|
||||||
(sum_constructor variant: (identifier) @constructor)
|
(declaration name: (identifier) @function type: (function_type))
|
||||||
(sum_pattern variant: (identifier) @constructor)
|
(declaration name: (identifier) @type.definition value: (type_definition))
|
||||||
(bits_member (identifier) @constant)
|
(pipeline_callable (identifier) @function.call .)
|
||||||
|
(aggregate_pipeline_callable (identifier) @function.call .)
|
||||||
(constraint_entry name: (identifier) @function)
|
(constraint_entry name: (identifier) @function)
|
||||||
(output_type function: (identifier) @function)
|
(output_type function: (identifier) @function)
|
||||||
(output_type function: (qualified_name (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
|
] @operator
|
||||||
|
|
||||||
|
["(" ")" "[" "]" "{" "}" ":" ";" "," "."] @punctuation
|
||||||
@@ -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
@@ -6,8 +6,10 @@
|
|||||||
"scope": "source.lscript",
|
"scope": "source.lscript",
|
||||||
"path": ".",
|
"path": ".",
|
||||||
"file-types": [
|
"file-types": [
|
||||||
"ls"
|
"ls",
|
||||||
|
"lscript"
|
||||||
],
|
],
|
||||||
|
"tags": "queries/tags.scm",
|
||||||
"highlights": "queries/highlights.scm"
|
"highlights": "queries/highlights.scm"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in new issue
Block a user