Skip to content

Commit

Permalink
Add language support for Quint (#11898)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <[email protected]>
  • Loading branch information
gruhn and the-mikedavis authored Nov 20, 2024
1 parent 32ff0fc commit b8313da
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
| purescript ||| | `purescript-language-server` |
| python |||| `ruff`, `jedi-language-server`, `pylsp` |
| qml || || `qmlls` |
| quint || | | `quint-language-server` |
| r || | | `R` |
| racket || || `racket` |
| regex || | | |
Expand Down
14 changes: 14 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} }
basedpyright = { command = "basedpyright-langserver", args = ["--stdio"], config = {} }
pylyzer = { command = "pylyzer", args = ["--server"] }
qmlls = { command = "qmlls" }
quint-language-server = { command = "quint-language-server", args = ["--stdio"] }
r = { command = "R", args = ["--no-echo", "-e", "languageserver::run()"] }
racket = { command = "racket", args = ["-l", "racket-langserver"] }
regols = { command = "regols" }
Expand Down Expand Up @@ -3893,6 +3894,19 @@ indent = { tab-width = 4, unit = " " }
name = "cylc"
source = { git = "https://github.com/elliotfontaine/tree-sitter-cylc", rev = "30dd40d9bf23912e4aefa93eeb4c7090bda3d0f6" }

[[language]]
name = "quint"
scope = "source.quint"
file-types = ["qnt"]
language-servers = ["quint-language-server"]
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
indent = { tab-width = 2, unit = " " }

[[grammar]]
name = "quint"
source = { git = "https://github.com/gruhn/tree-sitter-quint", rev = "eebbd01edfeff6404778c92efe5554e42e506a18" }

[[language]]
name = "spade"
scope = "source.spade"
Expand Down
94 changes: 94 additions & 0 deletions runtime/queries/quint/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
[
"module"
"type"
"assume"
"const"
"var"
"val"
"nondet"
"def"
"pure"
"action"
"temporal"
"run"
] @keyword

(match_expr "match" @keyword.control.conditional)

(if_else_condition
"if" @keyword.control.conditional
"else" @keyword.control.conditional)

(import "import" @keyword.control.import)
(import "as" @keyword.control.import)
(import "from" @keyword.control.import)
(export "export" @keyword.control.import)
(export "as" @keyword.control.import)

[
"true"
"false"
"Int"
"Nat"
"Bool"
] @constant.builtin

[
";"
"."
","
] @punctuation.delimiter

[
"-"
"+"
"*"
"/"
"%"
"<"
"<="
"="
"=="
"!="
"=>"
">"
">="
"^"
"->"
] @operator

(infix_and "and" @operator)
(infix_or "or" @operator)
(infix_iff "iff" @operator)
(infix_implies "implies" @operator)

(braced_and "and" @keyword)
(braced_or "or" @keyword)
(braced_all "all" @keyword)
(braced_any "any" @keyword)

[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket

(polymorphic_type
(type) @type.parameter)

(variant_constructor) @type.enum.variant

(type) @type
(int_literal) @constant.numeric.integer
(comment) @comment
(string) @string

(operator_application
operator: (qualified_identifier) @function)

(operator_definition
name: (qualified_identifier) @function
arguments: (typed_argument_list))

0 comments on commit b8313da

Please sign in to comment.