Unnamed repository; edit this file 'description' to name the repository.
Add fish-lsp and bump tree-sitter-fish
Branch Vincent 2025-01-24
parent 122bbea · commit 0d5f6f0
-rw-r--r--book/src/generated/lang-support.md2
-rw-r--r--languages.toml4
-rw-r--r--runtime/queries/fish/highlights.scm22
3 files changed, 17 insertions, 11 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index 6f325821..9287ccb1 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -56,7 +56,7 @@
| erlang | ✓ | ✓ | | `erlang_ls`, `elp` |
| esdl | ✓ | | | |
| fidl | ✓ | | | |
-| fish | ✓ | ✓ | ✓ | |
+| fish | ✓ | ✓ | ✓ | `fish-lsp` |
| forth | ✓ | | | `forth-lsp` |
| fortran | ✓ | | ✓ | `fortls` |
| fsharp | ✓ | | | `fsautocomplete` |
diff --git a/languages.toml b/languages.toml
index 4a2e8a4f..27976375 100644
--- a/languages.toml
+++ b/languages.toml
@@ -38,6 +38,7 @@ elm-language-server = { command = "elm-language-server" }
elp = { command = "elp", args = ["server"] }
elvish = { command = "elvish", args = ["-lsp"] }
erlang-ls = { command = "erlang_ls" }
+fish-lsp = { command = "fish-lsp", args = ["start"], environment = { fish_lsp_show_client_popups = "false" } }
forc = { command = "forc", args = ["lsp"] }
forth-lsp = { command = "forth-lsp" }
fortls = { command = "fortls", args = ["--lowercase_intrinsics"] }
@@ -391,13 +392,14 @@ injection-regex = "fish"
file-types = ["fish"]
shebangs = ["fish"]
comment-token = "#"
+language-servers = ["fish-lsp"]
indent = { tab-width = 4, unit = " " }
auto-format = true
formatter = { command = "fish_indent" }
[[grammar]]
name = "fish"
-source = { git = "https://github.com/ram02z/tree-sitter-fish", rev = "84436cf24c2b3176bfbb220922a0fdbd0141e406" }
+source = { git = "https://github.com/ram02z/tree-sitter-fish", rev = "a78aef9abc395c600c38a037ac779afc7e3cc9e0" }
[[language]]
name = "mint"
diff --git a/runtime/queries/fish/highlights.scm b/runtime/queries/fish/highlights.scm
index 27d509a0..d9b5b427 100644
--- a/runtime/queries/fish/highlights.scm
+++ b/runtime/queries/fish/highlights.scm
@@ -4,14 +4,13 @@
"&&"
"||"
"|"
+ "&|"
+ "2>|"
"&"
- "="
- "!="
".."
"!"
(direction)
(stream_redirect)
- (test_option)
] @operator
[
@@ -39,12 +38,12 @@
"case"
] @keyword.control.conditional)
-(else_clause
+(else_clause
[
"else"
] @keyword.control.conditional)
-(else_if_clause
+(else_if_clause
[
"else"
"if"
@@ -96,6 +95,14 @@
;; Commands
(command
+ name: (word) @function.builtin (#match? @function.builtin "^test$")
+ argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$"))
+
+(command
+ name: (word) @punctuation.bracket (#match? @punctuation.bracket "^\\[$")
+ argument: (word) @operator (#match? @operator "^(!?=|-[a-zA-Z]+)$"))
+
+(command
argument: [
(word) @variable.parameter (#match? @variable.parameter "^-")
]
@@ -109,8 +116,6 @@
]
)
-(test_command "test" @function.builtin)
-
; non-builtin command names
(command name: (word) @function)
@@ -121,7 +126,7 @@
(function_definition
name: [
(word) (concatenation)
- ]
+ ]
@function)
(function_definition
@@ -146,7 +151,6 @@
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(comment) @comment
-(test_option) @string
((word) @constant.builtin.boolean
(#match? @constant.builtin.boolean "^(true|false)$"))