mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
initial support for CodeQL
This commit is contained in:
parent
b66b533ecd
commit
3dc2e9331e
3 changed files with 137 additions and 0 deletions
|
|
@ -261,6 +261,14 @@ list.fennel = {
|
|||
maintainers = {'@TravonteD'},
|
||||
}
|
||||
|
||||
list.ql = {
|
||||
install_info = {
|
||||
url = "https://github.com/tree-sitter/tree-sitter-ql",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = {'@pwntester'},
|
||||
}
|
||||
|
||||
-- Parsers for injections
|
||||
list.regex = {
|
||||
install_info = {
|
||||
|
|
|
|||
103
queries/ql/highlights.scm
Normal file
103
queries/ql/highlights.scm
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
[
|
||||
"and"
|
||||
"any"
|
||||
"as"
|
||||
"asc"
|
||||
"avg"
|
||||
"by"
|
||||
"class"
|
||||
"concat"
|
||||
"count"
|
||||
"desc"
|
||||
"else"
|
||||
"exists"
|
||||
"extends"
|
||||
"forall"
|
||||
"forex"
|
||||
"from"
|
||||
"if"
|
||||
"implies"
|
||||
"import"
|
||||
"in"
|
||||
"instanceof"
|
||||
"max"
|
||||
"min"
|
||||
"module"
|
||||
"newtype"
|
||||
"not"
|
||||
"or"
|
||||
"order"
|
||||
"rank"
|
||||
"select"
|
||||
"strictconcat"
|
||||
"strictcount"
|
||||
"strictsum"
|
||||
"sum"
|
||||
"then"
|
||||
"where"
|
||||
|
||||
(false)
|
||||
(predicate)
|
||||
(result)
|
||||
(specialId)
|
||||
(super)
|
||||
(this)
|
||||
(true)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"boolean"
|
||||
"float"
|
||||
"int"
|
||||
"date"
|
||||
"string"
|
||||
] @type.builtin
|
||||
|
||||
(annotName) @attribute
|
||||
|
||||
[
|
||||
"<"
|
||||
"<="
|
||||
"="
|
||||
">"
|
||||
">="
|
||||
"-"
|
||||
"!="
|
||||
"/"
|
||||
"*"
|
||||
"%"
|
||||
"+"
|
||||
"::"
|
||||
] @operator
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
"|"
|
||||
] @punctuation.delimiter
|
||||
|
||||
(className) @type
|
||||
|
||||
(varName) @variable
|
||||
|
||||
(integer) @number
|
||||
(float) @number
|
||||
|
||||
(string) @string
|
||||
|
||||
(aritylessPredicateExpr (literalId) @function)
|
||||
(predicateName) @function
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
(qldoc)
|
||||
] @comment
|
||||
26
queries/ql/locals.scm
Normal file
26
queries/ql/locals.scm
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
(classlessPredicate
|
||||
name: (predicateName) @name) @definition.function
|
||||
|
||||
(memberPredicate
|
||||
name: (predicateName) @name) @definition.method
|
||||
|
||||
(aritylessPredicateExpr
|
||||
name: (literalId) @name) @reference.call
|
||||
|
||||
(module
|
||||
name: (moduleName) @name) @definition.module
|
||||
|
||||
(dataclass
|
||||
name: (className) @name) @definition.class
|
||||
|
||||
(datatype
|
||||
name: (className) @name) @definition.class
|
||||
|
||||
(datatypeBranch
|
||||
name: (className) @name) @definition.class
|
||||
|
||||
(qualifiedRhs
|
||||
name: (predicateName) @name) @reference.call
|
||||
|
||||
(typeExpr
|
||||
name: (className) @name) @reference.type
|
||||
Loading…
Add table
Add a link
Reference in a new issue