diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-07-18 22:01:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-18 19:01:46 -0700 |
| commit | 5f07e61010f495e5ebde1b71b2c74cb52765363a (patch) | |
| tree | 409629604e54267e8bee50b23f348ca5088ea986 /lsp/glint.lua | |
| parent | docs: update configs.md (diff) | |
| download | nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.tar nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.tar.gz nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.tar.bz2 nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.tar.lz nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.tar.xz nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.tar.zst nvim-lspconfig-5f07e61010f495e5ebde1b71b2c74cb52765363a.zip | |
refactor(glint): use `cmd(…, config)` #3960
Problem:
The glint config `cmd()` gets its config from the currently resolved
global config, which may be different than the one for the current
client.
Solution:
Since Nvim 0.11.3 https://github.com/neovim/neovim/issues/34547
`cmd()` receives a `config` arg, so use that instead.
Diffstat (limited to 'lsp/glint.lua')
| -rw-r--r-- | lsp/glint.lua | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lsp/glint.lua b/lsp/glint.lua index d4a745c4..2ed30bb5 100644 --- a/lsp/glint.lua +++ b/lsp/glint.lua @@ -22,21 +22,10 @@ --- }, --- }) -function get_cmd() - local useGlobal = vim.lsp.config.glint.init_options.glint.useGlobal - if useGlobal then - return { 'glint-language-server' } - end - - local root_markers = vim.lsp.config.glint.root_markers - local root_dir = vim.fs.root(0, root_markers) - - return { root_dir .. '/node_modules/.bin/glint-language-server' } -end - return { - cmd = function(dispatchers) - local cmd = get_cmd() + cmd = function(dispatchers, config) + local cmd = (config.init_options.glint.useGlobal or not config.root_dir) and { 'glint-language-server' } + or { config.root_dir .. '/node_modules/.bin/glint-language-server' } return vim.lsp.rpc.start(cmd, dispatchers) end, init_options = { |
