We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
on_attach
1 parent 0e224f3 commit 3e75599Copy full SHA for 3e75599
lua/astrolsp/init.lua
@@ -25,15 +25,11 @@ end
25
---@param client lsp.Client
26
---@param bufnr integer
27
local function check_cond(cond, client, bufnr)
28
- local active = true
29
- if type(cond) == "function" then
30
- active = cond(client, bufnr)
31
- elseif type(cond) == "string" then
32
- active = client.supports_method(cond)
33
- elseif type(cond) == "boolean" then
34
- active = cond
35
- end
36
- return active
+ local cond_type = type(cond)
+ if cond_type == "function" then return cond(client, bufnr) end
+ if cond_type == "string" then return client.supports_method(cond) end
+ if cond_type == "boolean" then return cond end
+ return true
37
end
38
39
--- A table of settings for different levels of diagnostics
0 commit comments