aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSola <dev@sola.love>2025-05-26 23:30:12 +0800
committerGitHub <noreply@github.com>2025-05-26 08:30:12 -0700
commit2a38a426a240dcc94f2677911598136e839a7b97 (patch)
tree1c6dde5ec49eebde4fc08bc925210e36a0a7ea9b
parentdocs: update configs.md (diff)
downloadnvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.tar
nvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.tar.gz
nvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.tar.bz2
nvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.tar.lz
nvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.tar.xz
nvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.tar.zst
nvim-lspconfig-2a38a426a240dcc94f2677911598136e839a7b97.zip
fix(fish_lsp): various improvements #3869
Apply suggestions brought up by the `fish_lsp` author: https://github.com/mason-org/mason-registry/pull/8609#issuecomment-2904347943
-rw-r--r--lsp/fish_lsp.lua3
-rw-r--r--lua/lspconfig/configs/fish_lsp.lua6
2 files changed, 5 insertions, 4 deletions
diff --git a/lsp/fish_lsp.lua b/lsp/fish_lsp.lua
index d368c55c..73055cad 100644
--- a/lsp/fish_lsp.lua
+++ b/lsp/fish_lsp.lua
@@ -10,7 +10,6 @@
--- [homepage](https://www.fish-lsp.dev/)
return {
cmd = { 'fish-lsp', 'start' },
- cmd_env = { fish_lsp_show_client_popups = false },
filetypes = { 'fish' },
- root_markers = { '.git' },
+ root_markers = { 'config.fish', '.git' },
}
diff --git a/lua/lspconfig/configs/fish_lsp.lua b/lua/lspconfig/configs/fish_lsp.lua
index 8339163e..ad206897 100644
--- a/lua/lspconfig/configs/fish_lsp.lua
+++ b/lua/lspconfig/configs/fish_lsp.lua
@@ -1,10 +1,12 @@
+local util = require 'lspconfig.util'
+
return {
default_config = {
cmd = { 'fish-lsp', 'start' },
- cmd_env = { fish_lsp_show_client_popups = false },
filetypes = { 'fish' },
root_dir = function(fname)
- return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
+ return util.root_pattern('config.fish')(fname)
+ or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1])
end,
single_file_support = true,
},