language support: CodeQL (#12470)

This commit is contained in:
Evan Richter 2025-01-10 08:03:04 -07:00 committed by GitHub
parent a83c23bb03
commit 9721144e03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 137 additions and 0 deletions

View file

@ -23,6 +23,7 @@
| circom | ✓ | | | `circom-lsp` |
| clojure | ✓ | | | `clojure-lsp` |
| cmake | ✓ | ✓ | ✓ | `cmake-language-server` |
| codeql | ✓ | ✓ | | `codeql` |
| comment | ✓ | | | |
| common-lisp | ✓ | | ✓ | `cl-lsp` |
| cpon | ✓ | | ✓ | |

View file

@ -21,6 +21,7 @@ cl-lsp = { command = "cl-lsp", args = [ "stdio" ] }
clangd = { command = "clangd" }
clojure-lsp = { command = "clojure-lsp" }
cmake-language-server = { command = "cmake-language-server" }
codeql = { command = "codeql", args = ["execute", "language-server", "--check-errors=ON_CHANGE"] }
crystalline = { command = "crystalline", args = ["--stdio"] }
cs = { command = "cs", args = ["launch", "--contrib", "smithy-language-server", "--", "0"] }
csharp-ls = { command = "csharp-ls" }
@ -4033,3 +4034,18 @@ indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "nginx"
source = { git = "https://gitlab.com/joncoole/tree-sitter-nginx", rev = "b4b61db443602b69410ab469c122c01b1e685aa0" }
[[language]]
name = "codeql"
scope = "source.ql"
file-types = ["ql", "qll"]
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
indent = { tab-width = 2, unit = " " }
injection-regex = "codeql"
grammar = "ql"
language-servers = ["codeql"]
[[grammar]]
name = "ql"
source = { git = "https://github.com/tree-sitter/tree-sitter-ql", rev = "1fd627a4e8bff8c24c11987474bd33112bead857" }

View file

@ -0,0 +1,104 @@
[
"and"
"any"
"as"
"asc"
"avg"
"by"
"class"
"concat"
"count"
"desc"
"else"
"exists"
"extends"
"forall"
"forex"
"from"
"if"
"implements"
"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) @constant.numeric.integer
(float) @constant.numeric.float
(string) @string
(aritylessPredicateExpr (literalId) @function)
(predicateName) @function
[
(line_comment)
(block_comment)
(qldoc)
] @comment

View file

@ -0,0 +1,16 @@
(qldoc) @comment.around
(block_comment) @comment.around
(line_comment) @comment.inside
(line_comment)+ @comment.around
(classlessPredicate
((varDecl) @parameter.inside . ","?) @parameter.around
(body "{" (_)* @function.inside "}")) @function.around
(memberPredicate
((varDecl) @parameter.inside . ","?) @parameter.around
(body "{" (_)* @function.inside "}")) @function.around
(dataclass
("{" (_)* @class.inside "}")?) @class.around
(datatype) @class.around
(datatypeBranch) @class.around