mirror of
https://github.com/neovim/neovim.git
synced 2025-10-22 17:11:49 +00:00
refactor(lsp): check supported methods instead of tbl_get
This commit is contained in:
@@ -1089,11 +1089,11 @@ function Client:on_attach(bufnr)
|
|||||||
-- on_attach and LspAttach callbacks the ability to schedule wrap the
|
-- on_attach and LspAttach callbacks the ability to schedule wrap the
|
||||||
-- opt-out (deleting the semanticTokensProvider from capabilities)
|
-- opt-out (deleting the semanticTokensProvider from capabilities)
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
if vim.tbl_get(self.server_capabilities, 'semanticTokensProvider', 'full') then
|
if self:supports_method(ms.textDocument_semanticTokens_full) then
|
||||||
lsp.semantic_tokens._start(bufnr, self.id)
|
lsp.semantic_tokens._start(bufnr, self.id)
|
||||||
end
|
end
|
||||||
if vim.tbl_get(self.server_capabilities, 'foldingRangeProvider') then
|
if self:supports_method(ms.textDocument_foldingRange) then
|
||||||
lsp._folding_range._setup(bufnr)
|
lsp._folding_range._setup(bufnr, self.id)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user