aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/lsp')
-rw-r--r--runtime/lua/vim/lsp/client.lua3
-rw-r--r--runtime/lua/vim/lsp/health.lua42
-rw-r--r--runtime/lua/vim/lsp/inlay_hint.lua4
3 files changed, 29 insertions, 20 deletions
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua
index 8c75ee321d..b256eab1a6 100644
--- a/runtime/lua/vim/lsp/client.lua
+++ b/runtime/lua/vim/lsp/client.lua
@@ -63,6 +63,9 @@ local validate = vim.validate
--- folder in this list. See `workspaceFolders` in the LSP spec.
--- @field workspace_folders? lsp.WorkspaceFolder[]
---
+--- (default false) Server requires a workspace (no "single file" support).
+--- @field workspace_required? boolean
+---
--- Map overriding the default capabilities defined by |vim.lsp.protocol.make_client_capabilities()|,
--- passed to the language server on initialization. Hint: use make_client_capabilities() and modify
--- its result.
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua
index 8af9f2f791..04e8393eb3 100644
--- a/runtime/lua/vim/lsp/health.lua
+++ b/runtime/lua/vim/lsp/health.lua
@@ -187,26 +187,32 @@ local function check_enabled_configs()
local config = vim.lsp.config[name]
local text = {} --- @type string[]
text[#text + 1] = ('%s:'):format(name)
- for k, v in
- vim.spairs(config --[[@as table<string,any>]])
- do
- local v_str --- @type string?
- if k == 'name' then
- v_str = nil
- elseif k == 'filetypes' or k == 'root_markers' then
- v_str = table.concat(v, ', ')
- elseif type(v) == 'function' then
- v_str = func_tostring(v)
- else
- v_str = vim.inspect(v, { newline = '\n ' })
- end
+ if not config then
+ report_warn(
+ ("'%s' config not found. Ensure that vim.lsp.config('%s') was called."):format(name, name)
+ )
+ else
+ for k, v in
+ vim.spairs(config --[[@as table<string,any>]])
+ do
+ local v_str --- @type string?
+ if k == 'name' then
+ v_str = nil
+ elseif k == 'filetypes' or k == 'root_markers' then
+ v_str = table.concat(v, ', ')
+ elseif type(v) == 'function' then
+ v_str = func_tostring(v)
+ else
+ v_str = vim.inspect(v, { newline = '\n ' })
+ end
- if k == 'cmd' and type(v) == 'table' and vim.fn.executable(v[1]) == 0 then
- report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1]))
- end
+ if k == 'cmd' and type(v) == 'table' and vim.fn.executable(v[1]) == 0 then
+ report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1]))
+ end
- if v_str then
- text[#text + 1] = ('- %s: %s'):format(k, v_str)
+ if v_str then
+ text[#text + 1] = ('- %s: %s'):format(k, v_str)
+ end
end
end
text[#text + 1] = ''
diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua
index ab3a269937..a37fa42aac 100644
--- a/runtime/lua/vim/lsp/inlay_hint.lua
+++ b/runtime/lua/vim/lsp/inlay_hint.lua
@@ -94,10 +94,10 @@ function M.on_refresh(err, _, ctx)
for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do
for _, winid in ipairs(api.nvim_list_wins()) do
if api.nvim_win_get_buf(winid) == bufnr then
- if bufstates[bufnr] then
+ if bufstates[bufnr] and bufstates[bufnr].enabled then
bufstates[bufnr].applied = {}
+ util._refresh(ms.textDocument_inlayHint, { bufnr = bufnr })
end
- util._refresh(ms.textDocument_inlayHint, { bufnr = bufnr })
end
end
end