Compare commits

...

9 Commits

Author SHA1 Message Date
evie
6fffaf6a7d add highlighting for nearley (#14482) 2025-10-04 15:22:28 -04:00
Lingxuan Ye
81b4a2c9d8 style: unify verbs in help message to base form (#14501) 2025-10-04 15:22:13 -04:00
alschena
e50e8a3638 feat(languages): add support for the eiffel programming language (#14470)
Co-authored-by: Alessandro Schena <alessandro.schena@constructor.org>
2025-10-04 15:12:09 -04:00
may
0a2972980f queries(scheme): properly highlight define-values (#14504) 2025-10-04 15:01:45 -04:00
Maksymilian Wrzesień
a8ac3c5010 feat: enable comment highlights in jsonnet (#14527) 2025-10-04 14:59:28 -04:00
Remo Senekowitsch
5c3e4b67d9 Add injections for mise config (#14525) 2025-10-04 14:55:40 -04:00
Will Faught
cb3c450125 Add .itermcolors to xml file types (#14531) 2025-10-04 14:55:00 -04:00
Will Faught
f327307faa Add .terminal to xml file types (#14532) 2025-10-04 14:49:43 -04:00
Remo Senekowitsch
abe82e7474 Add injections for inline scripts in jj config (#14530) 2025-10-04 14:48:54 -04:00
16 changed files with 350 additions and 22 deletions

View File

@@ -57,6 +57,7 @@
| earthfile | ✓ | ✓ | ✓ | | | `earthlyls` |
| edoc | ✓ | | | | | |
| eex | ✓ | | | | | |
| eiffel | ✓ | ✓ | ✓ | | | `eiffel-language-server` |
| ejs | ✓ | | | | | |
| elisp | ✓ | | | ✓ | | |
| elixir | ✓ | ✓ | ✓ | ✓ | ✓ | `elixir-ls`, `expert` |
@@ -168,10 +169,12 @@
| mermaid | ✓ | | | | | |
| meson | ✓ | | ✓ | | | `mesonlsp` |
| mint | | | | | | `mint` |
| miseconfig | ✓ | ✓ | ✓ | | | `taplo`, `tombi` |
| mojo | ✓ | ✓ | ✓ | | | `pixi` |
| move | ✓ | | | | | |
| msbuild | ✓ | | ✓ | | | |
| nasm | ✓ | ✓ | | | | `asm-lsp` |
| nearley | ✓ | | | | ✓ | |
| nestedtext | ✓ | ✓ | ✓ | | | |
| nginx | ✓ | | | | | |
| nickel | ✓ | | ✓ | | | `nls` |

View File

@@ -56,24 +56,24 @@ USAGE:
hx [FLAGS] [files]...
ARGS:
<files>... Sets the input file to use, position can also be specified via file[:row[:col]]
<files>... Set the input file to use, position can also be specified via file[:row[:col]]
FLAGS:
-h, --help Prints help information
--tutor Loads the tutorial
--health [CATEGORY] Checks for potential errors in editor setup
-h, --help Print help information
--tutor Load the tutorial
--health [CATEGORY] Check for potential errors in editor setup
CATEGORY can be a language or one of 'clipboard', 'languages',
'all-languages' or 'all'. 'languages' is filtered according to
user config, 'all-languages' and 'all' are not. If not specified,
the default is the same as 'all', but with languages filtering.
-g, --grammar {{fetch|build}} Fetches or builds tree-sitter grammars listed in languages.toml
-c, --config <file> Specifies a file to use for configuration
-v Increases logging verbosity each use for up to 3 times
--log <file> Specifies a file to use for logging
-g, --grammar {{fetch|build}} Fetch or builds tree-sitter grammars listed in languages.toml
-c, --config <file> Specify a file to use for configuration
-v Increase logging verbosity each use for up to 3 times
--log <file> Specify a file to use for logging
(default file: {})
-V, --version Prints version information
--vsplit Splits all given files vertically into different windows
--hsplit Splits all given files horizontally into different windows
-V, --version Print version information
--vsplit Split all given files vertically into different windows
--hsplit Split all given files horizontally into different windows
-w, --working-dir <path> Specify an initial working directory
+N Open the first given file at line number N
",

View File

@@ -38,6 +38,7 @@ docker-compose-langserver = { command = "docker-compose-langserver", args = ["--
dot-language-server = { command = "dot-language-server", args = ["--stdio"] }
dts-lsp = { command = "dts-lsp" }
earthlyls = { command = "earthlyls" }
eiffel-language-server = {command = "eiffel-language-server"}
elixir-ls = { command = "elixir-ls", config = { elixirLS.dialyzerEnabled = false } }
elm-language-server = { command = "elm-language-server" }
elp = { command = "elp", args = ["server"] }
@@ -422,6 +423,17 @@ auto-format = true
name = "textproto"
source = { git = "https://github.com/PorterAtGoogle/tree-sitter-textproto", rev = "568471b80fd8793d37ed01865d8c2208a9fefd1b"}
[[language]]
name = "eiffel"
scope = "source.eiffel"
file-types = ["e"]
comment-token = "--"
language-servers = ["eiffel-language-server"]
[[grammar]]
name = "eiffel"
source = { git = "https://github.com/imustafin/tree-sitter-eiffel", rev = "d934fb44f1d22bb76be6b56a7b2425ab3b1daf8b" }
[[language]]
name = "elixir"
scope = "source.elixir"
@@ -3046,6 +3058,8 @@ file-types = [
"gpx",
"fodt",
"fods",
"itermcolors",
"terminal",
]
block-comment-tokens = { start = "<!--", end = "-->" }
indent = { tab-width = 2, unit = " " }
@@ -3710,6 +3724,25 @@ file-types = ["jjtemplate"]
name = "jjtemplate"
source = { git = "https://github.com/bryceberger/tree-sitter-jjtemplate", rev = "4313eda8ac31c60e550e3ad5841b100a0a686715" }
[[language]]
name = "miseconfig"
scope = "source.miseconfig"
injection-regex = "miseconfig"
grammar = "toml"
file-types = [
{ glob = "mise.toml" },
{ glob = ".mise.toml" },
{ glob = "mise.*.toml" },
{ glob = ".mise.*.toml" },
{ glob = "mise/config.toml" },
{ glob = ".mise/config.toml" },
{ glob = ".config/mise.toml" },
{ glob = ".config/mise/conf.d/*.toml" },
]
comment-token = "#"
language-servers = [ "taplo", "tombi" ]
indent = { tab-width = 2, unit = " " }
[[language]]
name = "jq"
scope = "source.jq"
@@ -4832,7 +4865,7 @@ indent = { tab-width = 2, unit = " " }
block-comment-tokens = { start = "<!--", end = "-->" }
word-completion.trigger-length = 4
[[language]]
[[language]]
name = "slisp"
scope = "source.sl"
injection-regex = "sl"
@@ -4843,3 +4876,14 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "slisp"
source = { git = "https://github.com/xenogenics/tree-sitter-slisp", rev = "29f9c6707ce9dfc2fc915d175ec720b207f179f3" }
[[language]]
name = "nearley"
scope = "source.nearley"
file-types = ["ne"]
comment-token = "#"
indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "nearley"
source = { git = "https://github.com/mi2ebi/tree-sitter-nearley", rev = "12d01113e194c8e83f6341aab8c2a5f21db9cac9" }

View File

@@ -0,0 +1,108 @@
[
"alias"
"convert"
"inherit"
"redefine"
"undefine"
"rename"
"select"
"note"
"create"
] @keyword.control.import
["export"] @keyword.control.export
[
"do"
"end"
"once"
"attribute"
] @keyword.control
[
"class"
"local"
] @keyword.storage.type
[
"feature"
"agent"
] @keyword.function
[
"frozen"
"deferred"
"detachable"
"expanded"
"attached"
"old"
"like"
] @keyword.storage.modifier
(conditional ["if" "elseif" "end"] @keyword.control.conditional)
(else_part ["else"] @keyword.control.conditional)
(then_part ["then"] @keyword.control.conditional)
(conditional_expression ["if" "else" "elseif" "end"] @keyword.control.conditional)
(else_part_expression ["else"] @keyword.control.conditional)
(then_part_expression ["then"] @keyword.control.conditional)
(multi_branch "inspect" @keyword.control.conditional)
(when_part ["when" "then"] @keyword.control.conditional)
(multi_branch_expression "inspect" @keyword.control.conditional)
(when_part_expression ["when" "then"] @keyword.control.conditional)
(quantifier_loop ["∀" "∃" ":" "¦"] @keyword.control.repeat)
(quantifier_loop_body ["all" "some"] @keyword.control.repeat)
(iteration ["across" "as"] @keyword.control.repeat)
(initialization "from" @keyword.control.repeat)
(exit_condition "until" @keyword.control.repeat)
(loop_body "loop" @keyword.control.repeat)
(variant "variant" @keyword.control.repeat)
(loop (invariant "invariant" @keyword.control.repeat))
(loop ["⟳" ":" "¦" "⟲"]@keyword.control.repeat)
(loop "end" @keyword.control.repeat)
[
"require"
"ensure"
"invariant"
"check"
] @keyword.control.exception
["(" ")" "[" "]" "<<" ">>"] @punctuation.bracket
["," ":" ";"] @punctuation.delimiter
[
(unary)
":="
(binary_caret)
(binary_mul_div)
(binary_plus_minus)
(binary_comparison)
(binary_and)
(binary_or)
(binary_implies)
(comparison)
(unary_not)
] @operator
(result) @variable.builtin
(anchored (call (_) @variable))
[(verbatim_string) (basic_manifest_string)] @string
[(integer_constant) (real_constant)] @constant.numeric
(boolean_constant) @constant.builtin.boolean
(void) @constant.builtin
(current) @variable.builtin
(extended_feature_name (identifier) @function.method)
(iteration (identifier) @variable)
(quantifier_loop (identifier) @variable)
(entity_declaration_group (identifier) @variable)
(class_name) @type
(formal_generic) @type.parameter
(comment) @comment.line
(header_comment) @comment.line.documentation

View File

@@ -0,0 +1,30 @@
[
(notes)
(class_declaration)
(inheritance)
(feature_adaptation)
(creation_clause)
(converters)
(feature_declaration)
(attribute_or_routine)
(precondition)
(local_declarations)
(feature_body)
(check)
(multi_branch)
(multi_branch_expression)
(conditional)
(conditional_expression)
(loop)
(quantifier_loop)
(iteration)
(postcondition)
(rescue)
(invariant)
] @indent

View File

@@ -0,0 +1,15 @@
[
(comment)+
(header_comment)+
] @comment.around
[
(comment)
(header_comment)
] @comment.inside
(formal_arguments) @parameter.around
(entity_declaration_group) @parameter.inside
(attribute_or_routine) @function.around
(feature_body) @function.inside
(class_declaration) @class.around
(feature_clause) @class.inside

View File

@@ -8,3 +8,18 @@
(table
(bare_key) @table-name (#any-of? @table-name "revsets" "revset-aliases")
[(pair (_) ((string) @injection.content (#set! injection.language "jjrevset"))) (comment)])
; Injections for aliases that contain inline scripts. (see `jj util exec --help`)
; This pattern currently relies on the language having the same name as its
; interpreter, which is often the case (sh, bash, python, fish, nu...)
; It also assumes the interpreter accepts the inline script with the "-c" flag.
(table
(bare_key) @table-name (#eq? @table-name "aliases")
(pair (_) (array .
(string) @util (#eq? @util "\"util\"") . (string) @exec (#eq? @exec "\"exec\"") . (string) @dd (#eq? @dd "\"--\"") .
(string) @injection.language .
; There are many possibilities to combine "-c" with other short flags, but by
; far the most common one should be the "-e" flag, which makes the script
; return early when an error occurs.
(string) @dc (#any-of? @dc "\"-c\"" "\"-ce\"" "\"-ec\"") .
(string) @injection.content)))

View File

@@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

View File

@@ -0,0 +1 @@
; inherits: toml

View File

@@ -0,0 +1 @@
; inherits: toml

View File

@@ -0,0 +1,34 @@
; inherits: toml
; This part covers simple tasks where only the command(s) to run
; are specified as a string or array of strings, e.g.
;
; [tasks]
; simple = "simple-command arg1 arg2"
; many-simple = [
; "simple-command-1",
; "simple-command-2",
; ]
;
(table
(bare_key) @table-name (#eq? @table-name "tasks")
(pair (_) [
((string) @injection.shebang @injection.content (#set! injection.language "bash"))
((array (string) @injection.shebang @injection.content (#set! injection.language "bash")))
])
)
; This part covers advanced tasks which are specified as a table.
; Only the "run" key is subject to injections.
;
; [tasks.foo]
; description = "This is regular text."
; run = "this is bash"
;
(table
(dotted_key (bare_key) @table-name (#eq? @table-name "tasks"))
(pair (bare_key) @key-name (#eq? @key-name "run") [
((string) @injection.shebang @injection.content (#set! injection.language "bash"))
((array (string) @injection.shebang @injection.content (#set! injection.language "bash")))
])
)

View File

@@ -0,0 +1 @@
; inherits: toml

View File

@@ -0,0 +1,43 @@
(comment) @comment.line
(string) @string
(string "i" @keyword.modifier)
(identifier) @variable.other
(rule_name (identifier) @function)
(rule (generic (identifier) @function))
(directive_name) @keyword.directive
(directive_value (identifier) @constant)
(directive_value (string) @string)
(token) @constant
(generic
"<" @punctuation.bracket
(identifier) @type.parameter
">" @punctuation.bracket
)
(group "(" @punctuation.bracket ")" @punctuation.bracket)
(charset) @string.regexp
(wildcard) @keyword
(quantifier) @function.builtin
(macro_name
"[" @punctuation.bracket
(identifier) @variable.parameter
"]" @punctuation.bracket
)
(macro_arg) @variable.parameter
(rule "->" @operator)
(rule_body "|" @operator)
(cont_block "@{%" @keyword.directive "%}" @keyword.directive)
(cont_inline "{%" @keyword.directive "%}" @keyword.directive)
(ifdef) @keyword.directive

View File

@@ -0,0 +1,2 @@
((cont) @injection.content
(#set! injection.language "javascript"))

View File

@@ -0,0 +1,3 @@
((group) @rainbow.scope)
["(" ")"] @rainbow.bracket

View File

@@ -46,7 +46,7 @@
.
(list
(symbol) @variable)
(#any-of? @_f "lambda" "λ"))
(#any-of? @_f "lambda" "λ" "define-values"))
(list
.
@@ -70,7 +70,7 @@
; operators
((symbol) @operator
(#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$"))
(#any-of? @operator "+" "-" "*" "/" "=" ">" "<" ">=" "<="))
; library
@@ -94,19 +94,45 @@
(list
.
((symbol) @keyword.conditional
(#match? @keyword.conditional "^(if|cond|case|when|unless)$"
)))
(#any-of? @keyword.conditional "if" "cond" "case" "when" "unless")))
(list
.
(symbol) @keyword
(#match? @keyword
"^(define-syntax|let\\*|lambda|λ|case-lambda|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$"
))
(#any-of? @keyword
"define-syntax" "let*" "lambda" "λ" "case-lambda" "case" "=>" "quote-splicing" "unquote-splicing"
"set!" "let" "letrec" "letrec-syntax" "let-values" "let*-values" "do" "else" "define" "cond"
"syntax-rules" "unquote" "begin" "quote" "let-syntax" "and" "if" "quasiquote" "letrec" "delay"
"or" "when" "unless" "identifier-syntax" "assert" "library" "export" "import" "rename" "only"
"except" "prefix" "define-values"))
(list
.
(symbol) @function.builtin
(#match? @function.builtin
"^(caar|cadr|call-with-input-file|call-with-output-file|cdar|cddr|list|open-input-file|open-output-file|with-input-from-file|with-output-to-file|\\*|\\+|-|/|<|<=|=|>|>=|abs|acos|angle|append|apply|asin|assoc|assq|assv|atan|boolean\\?|caaaar|caaadr|caaar|caadar|caaddr|caadr|cadaar|cadadr|cadar|caddar|cadddr|caddr|call-with-current-continuation|call-with-values|car|cdaaar|cdaadr|cdaar|cdadar|cdaddr|cdadr|cddaar|cddadr|cddar|cdddar|cddddr|cdddr|cdr|ceiling|char->integer|char-alphabetic\\?|char-ci<=\\?|char-ci<\\?|char-ci=\\?|char-ci>=\\?|char-ci>\\?|char-downcase|char-lower-case\\?|char-numeric\\?|char-ready\\?|char-upcase|char-upper-case\\?|char-whitespace\\?|char<=\\?|char<\\?|char=\\?|char>=\\?|char>\\?|char\\?|close-input-port|close-output-port|complex\\?|cons|cos|current-error-port|current-input-port|current-output-port|denominator|display|dynamic-wind|eof-object\\?|eq\\?|equal\\?|eqv\\?|eval|even\\?|exact->inexact|exact\\?|exp|expt|floor|flush-output|for-each|force|gcd|imag-part|inexact->exact|inexact\\?|input-port\\?|integer->char|integer\\?|interaction-environment|lcm|length|list->string|list->vector|list-ref|list-tail|list\\?|load|log|magnitude|make-polar|make-rectangular|make-string|make-vector|map|max|member|memq|memv|min|modulo|negative\\?|newline|not|null-environment|null\\?|number->string|number\\?|numerator|odd\\?|output-port\\?|pair\\?|peek-char|positive\\?|procedure\\?|quotient|rational\\?|rationalize|read|read-char|real-part|real\\?|remainder|reverse|round|scheme-report-environment|set-car!|set-cdr!|sin|sqrt|string|string->list|string->number|string->symbol|string-append|string-ci<=\\?|string-ci<\\?|string-ci=\\?|string-ci>=\\?|string-ci>\\?|string-copy|string-fill!|string-length|string-ref|string-set!|string<=\\?|string<\\?|string=\\?|string>=\\?|string>\\?|string\\?|substring|symbol->string|symbol\\?|tan|transcript-off|transcript-on|truncate|values|vector|vector->list|vector-fill!|vector-length|vector-ref|vector-set!|vector\\?|write|write-char|zero\\?)$"
))
(#any-of? @function.builtin
"caar" "cadr" "call-with-input-file" "call-with-output-file" "cdar" "cddr" "list"
"open-input-file" "open-output-file" "with-input-from-file" "with-output-to-file" "*" "+" "-"
"/" "<" "<=" "=" ">" ">=" "abs" "acos" "angle" "append" "apply" "asin" "assoc" "assq" "assv"
"atan" "boolean?" "caaaar" "caaadr" "caaar" "caadar" "caaddr" "caadr" "cadaar" "cadadr" "cadar"
"caddar" "cadddr" "caddr" "call-with-current-continuation" "call-with-values" "car" "cdaaar"
"cdaadr" "cdaar" "cdadar" "cdaddr" "cdadr" "cddaar" "cddadr" "cddar" "cdddar" "cddddr" "cdddr"
"cdr" "ceiling" "char->integer" "char-alphabetic?" "char-ci<=?" "char-ci<?" "char-ci=?"
"char-ci>=?" "char-ci>?" "char-downcase" "char-lower-case?" "char-numeric?" "char-ready?"
"char-upcase" "char-upper-case?" "char-whitespace?" "char<=?" "char<?" "char=?" "char>=?"
"char>?" "char?" "close-input-port" "close-output-port" "complex?" "cons" "cos"
"current-error-port" "current-input-port" "current-output-port" "denominator" "display"
"dynamic-wind" "eof-object?" "eq?" "equal?" "eqv?" "eval" "even?" "exact->inexact" "exact?" "exp"
"expt" "floor" "flush-output" "for-each" "force" "gcd" "imag-part" "inexact->exact" "inexact?"
"input-port?" "integer->char" "integer?" "interaction-environment" "lcm" "length" "list->string"
"list->vector" "list-ref" "list-tail" "list?" "load" "log" "magnitude" "make-polar"
"make-rectangular" "make-string" "make-vector" "map" "max" "member" "memq" "memv" "min" "modulo"
"negative?" "newline" "not" "null-environment" "null?" "number->string" "number?" "numerator"
"odd?" "output-port?" "pair?" "peek-char" "positive?" "procedure?" "quotient" "rational?"
"rationalize" "read" "read-char" "real-part" "real?" "remainder" "reverse" "round"
"scheme-report-environment" "set-car!" "set-cdr!" "sin" "sqrt" "string" "string->list"
"string->number" "string->symbol" "string-append" "string-ci<=?" "string-ci<?" "string-ci=?"
"string-ci>=?" "string-ci>?" "string-copy" "string-fill!" "string-length" "string-ref"
"string-set!" "string<=?" "string<?" "string=?" "string>=?" "string>?" "string?" "substring"
"symbol->string" "symbol?" "tan" "transcript-off" "transcript-on" "truncate" "values" "vector"
"vector->list" "vector-fill!" "vector-length" "vector-ref" "vector-set!" "vector?" "write"
"write-char" "zero?"))