Skip to content

Commit fb384fe

Browse files
authored
lsp-fish: Add support for fish-lsp. (#5027)
1 parent d5e956f commit fb384fe

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

CHANGELOG.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
* Add support for ~~crates-lsp~~
7979
* Remove outdated Ruff option and add new lint-related options
8080
* Add new Nextflow client customizations
81+
* Add support for ~~fish-lsp~~
8182

8283
** 9.0.0
8384
* Add language server config for QML (Qt Modeling Language) using qmlls.

clients/lsp-fish.el

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
;;; lsp-fish.el --- lsp-mode fish-shell integration -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2025-2026 lsp-mode maintainers
4+
5+
;; Author: lsp-mode maintainers
6+
;; Keywords: languages
7+
8+
;; This program is free software; you can redistribute it and/or modify
9+
;; it under the terms of the GNU General Public License as published by
10+
;; the Free Software Foundation, either version 3 of the License, or
11+
;; (at your option) any later version.
12+
13+
;; This program is distributed in the hope that it will be useful,
14+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
;; GNU General Public License for more details.
17+
18+
;; You should have received a copy of the GNU General Public License
19+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
;;; Commentary:
22+
23+
;; Client for fish, the user-friendly command line shell (https://github.com/fish-shell/fish-shell/)
24+
25+
;;; Code:
26+
27+
(require 'lsp-mode)
28+
29+
(defgroup lsp-fish nil
30+
"Settings for the fish-shell Language Server."
31+
:group 'lsp-mode
32+
:link '(url-link "https://fish-lsp.dev/")
33+
:package-version '(lsp-mode . "9.0.1"))
34+
35+
(defcustom lsp-fish-executable '("fish-lsp" "start")
36+
"Command to run the fish-shell language server."
37+
:group 'lsp-fish
38+
:risky t
39+
:type '(repeat string))
40+
41+
(lsp-dependency 'fish-language-server
42+
'(:system "fish-lsp"))
43+
44+
(lsp-register-client
45+
(make-lsp-client :server-id 'fish-lsp
46+
:new-connection (lsp-stdio-connection (lambda () lsp-fish-executable))
47+
:activation-fn (lsp-activate-on "fish")
48+
:major-modes '(fish-mode)))
49+
50+
(lsp-consistency-check lsp-fish)
51+
52+
(provide 'lsp-fish)
53+
;;; lsp-fish.el ends here

docs/lsp-clients.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@
367367
"lsp-install-server": "fsac",
368368
"debugger": "Yes (netcoredbg)"
369369
},
370+
{
371+
"name": "fish",
372+
"full-name": "Fish shell",
373+
"server-name": "fish-lsp",
374+
"server-url": "https://fish-lsp.dev/",
375+
"installation-url": "https://github.com/ndonfris/fish-lsp#installation",
376+
"debugger": "Not available"
377+
},
370378
{
371379
"name": "fortitude",
372380
"full-name": "Fortran",

lsp-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ As defined by the Language Server Protocol 3.16."
179179
lsp-clojure lsp-cmake lsp-cobol lsp-credo lsp-crystal lsp-csharp lsp-c3
180180
lsp-css lsp-copilot lsp-crates lsp-cucumber lsp-cypher lsp-d lsp-dart
181181
lsp-dhall lsp-docker lsp-dockerfile lsp-earthly lsp-elixir lsp-elm lsp-emmet
182-
lsp-erlang lsp-eslint lsp-fortitude lsp-fortran lsp-futhark lsp-fsharp lsp-gdscript
182+
lsp-erlang lsp-eslint lsp-fortitude lsp-fortran lsp-futhark lsp-fsharp lsp-fish lsp-gdscript
183183
lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly lsp-graphql
184184
lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript
185185
lsp-just lsp-jq lsp-json lsp-kotlin lsp-kubernetes-helm lsp-latex lsp-lisp
@@ -864,6 +864,7 @@ Changes take effect only when a new session is started."
864864
(ebuild-mode . "shellscript")
865865
(pkgbuild-mode . "shellscript")
866866
(envrc-file-mode . "shellscript")
867+
(fish-mode . "fish")
867868
(scala-mode . "scala")
868869
(scala-ts-mode . "scala")
869870
(julia-mode . "julia")

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ nav:
8787
- Erlang (ELP): page/lsp-erlang-elp.md
8888
- ESLint: page/lsp-eslint.md
8989
- F#: page/lsp-fsharp.md
90+
- Fish (fish-lsp): page/lsp-fish.md
9091
- Fortran (fortls): page/lsp-fortran.md
9192
- Fortran (fortitude): page/lsp-fortitude.md
9293
- Futhark: page/lsp-futhark.md

0 commit comments

Comments
 (0)