mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
7
runtime/queries/ql/folds.scm
Normal file
7
runtime/queries/ql/folds.scm
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[
|
||||
(module)
|
||||
(classlessPredicate)
|
||||
(dataclass)
|
||||
(charpred)
|
||||
(memberPredicate)
|
||||
] @fold
|
||||
135
runtime/queries/ql/highlights.scm
Normal file
135
runtime/queries/ql/highlights.scm
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
[
|
||||
"as"
|
||||
"by"
|
||||
"class"
|
||||
"extends"
|
||||
"from"
|
||||
"implies"
|
||||
"in"
|
||||
"module"
|
||||
"newtype"
|
||||
"order"
|
||||
"select"
|
||||
"where"
|
||||
|
||||
(predicate)
|
||||
(result)
|
||||
(specialId)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"and"
|
||||
"not"
|
||||
"or"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"avg"
|
||||
"any"
|
||||
"count"
|
||||
"concat"
|
||||
"exists"
|
||||
"max"
|
||||
"min"
|
||||
"instanceof"
|
||||
"rank"
|
||||
"sum"
|
||||
"strictconcat"
|
||||
"strictcount"
|
||||
"strictsum"
|
||||
] @function.builtin
|
||||
|
||||
"import" @include
|
||||
|
||||
[
|
||||
"if"
|
||||
"then"
|
||||
"else"
|
||||
] @conditional
|
||||
|
||||
[
|
||||
"forall"
|
||||
"forex"
|
||||
] @repeat
|
||||
|
||||
[
|
||||
"asc"
|
||||
"desc"
|
||||
] @type.qualifier
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
[
|
||||
(this)
|
||||
(super)
|
||||
] @variable.builtin
|
||||
|
||||
[
|
||||
"boolean"
|
||||
"float"
|
||||
"int"
|
||||
"date"
|
||||
"string"
|
||||
] @type.builtin
|
||||
|
||||
(annotName) @attribute
|
||||
|
||||
[
|
||||
"<"
|
||||
"<="
|
||||
"="
|
||||
">"
|
||||
">="
|
||||
"-"
|
||||
"!="
|
||||
"/"
|
||||
"*"
|
||||
"%"
|
||||
"+"
|
||||
"::"
|
||||
] @operator
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
"|"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(moduleExpr (simpleId) @namespace)
|
||||
(module name: (moduleName) @namespace)
|
||||
|
||||
(dataclass name: (className) @type)
|
||||
(typeExpr name: (className) @type)
|
||||
|
||||
(datatype name: (className) @type.definition)
|
||||
|
||||
(importModuleExpr qualName: (simpleId) @variable)
|
||||
(varName) @variable
|
||||
|
||||
(integer) @number
|
||||
(float) @float
|
||||
|
||||
(string) @string
|
||||
|
||||
(aritylessPredicateExpr (literalId) @function)
|
||||
(memberPredicate name: (predicateName) @function)
|
||||
(classlessPredicate name: (predicateName) @function)
|
||||
(charpred (className) @function)
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment @spell
|
||||
|
||||
(qldoc) @comment.documentation
|
||||
23
runtime/queries/ql/indents.scm
Normal file
23
runtime/queries/ql/indents.scm
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
[
|
||||
(module)
|
||||
(dataclass)
|
||||
(classMember)
|
||||
(classlessPredicate)
|
||||
(quantified)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
")"
|
||||
"}"
|
||||
] @indent.end
|
||||
|
||||
[
|
||||
")"
|
||||
"}"
|
||||
] @indent.branch
|
||||
|
||||
[
|
||||
(block_comment)
|
||||
(line_comment)
|
||||
(qldoc)
|
||||
] @indent.ignore
|
||||
6
runtime/queries/ql/injections.scm
Normal file
6
runtime/queries/ql/injections.scm
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
([
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
(qldoc)
|
||||
] @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
30
runtime/queries/ql/locals.scm
Normal file
30
runtime/queries/ql/locals.scm
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
; SCOPES
|
||||
(module) @scope
|
||||
(dataclass) @scope
|
||||
(datatype) @scope
|
||||
;; TODO does not work
|
||||
;(classMember (body) @scope)
|
||||
(memberPredicate (body) @scope)
|
||||
(classlessPredicate (body) @scope)
|
||||
(quantified (conjunction) @scope)
|
||||
(select) @scope
|
||||
|
||||
; DEFINITIONS
|
||||
|
||||
; module
|
||||
(module name: (moduleName) @definition.namespace)
|
||||
|
||||
; classes
|
||||
(dataclass name: (className) @definition.type)
|
||||
(datatype name: (className) @definition.type)
|
||||
|
||||
; predicates
|
||||
(charpred (className) @definition.method)
|
||||
(memberPredicate name: (predicateName) @definition.method)
|
||||
(classlessPredicate name: (predicateName) @definition.function)
|
||||
|
||||
; variables
|
||||
(varDecl (varName (simpleId) @definition.var))
|
||||
|
||||
; REFERENCES
|
||||
(simpleId) @reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue