Skip to content

Commit

Permalink
Add fish-lsp and bump tree-sitter-fish
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent authored and nik-rev committed Jan 24, 2025
1 parent 64ca09b commit 682f91f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
| erlang ||| | `erlang_ls`, `elp` |
| esdl || | | |
| fidl || | | |
| fish |||| |
| fish |||| `fish-lsp` |
| forth || | | `forth-lsp` |
| fortran || || `fortls` |
| fsharp || | | `fsautocomplete` |
Expand Down
4 changes: 3 additions & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down Expand Up @@ -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"
Expand Down
22 changes: 13 additions & 9 deletions runtime/queries/fish/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
"&&"
"||"
"|"
"&|"
"2>|"
"&"
"="
"!="
".."
"!"
(direction)
(stream_redirect)
(test_option)
] @operator

[
Expand Down Expand Up @@ -39,12 +38,12 @@
"case"
] @keyword.control.conditional)

(else_clause
(else_clause
[
"else"
] @keyword.control.conditional)

(else_if_clause
(else_if_clause
[
"else"
"if"
Expand Down Expand Up @@ -95,6 +94,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 "^-")
Expand All @@ -109,8 +116,6 @@
]
)

(test_command "test" @function.builtin)

; non-builtin command names
(command name: (word) @function)

Expand All @@ -121,7 +126,7 @@
(function_definition
name: [
(word) (concatenation)
]
]
@function)

(function_definition
Expand All @@ -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)$"))
Expand Down

0 comments on commit 682f91f

Please sign in to comment.