protect calls to lsp/wtf funcs as most of them are only on dev builds atm
This commit is contained in:
@@ -16,21 +16,21 @@ auto('LspAttach', {
|
|||||||
-- highlight color codes via lsp (supported by cssls)
|
-- highlight color codes via lsp (supported by cssls)
|
||||||
-- #ff0000
|
-- #ff0000
|
||||||
if client:supports_method('textDocument/documentColor') then
|
if client:supports_method('textDocument/documentColor') then
|
||||||
vim.lsp.document_color.enable(true, ctx.buf)
|
pcall(vim.lsp.document_color.enable, true, ctx.buf)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- enable linked editing this allows lsps to modify things like html tags
|
-- enable linked editing this allows lsps to modify things like html tags
|
||||||
-- for example when you change <p> to <a> </p> will be changed by the lsp
|
-- for example when you change <p> to <a> </p> will be changed by the lsp
|
||||||
-- to </a>
|
-- to </a>
|
||||||
if client:supports_method('textDocument/linkedEditingRange') then
|
if client:supports_method('textDocument/linkedEditingRange') then
|
||||||
vim.lsp.linked_editing_range.enable(true, { client_id = client.id })
|
pcall(vim.lsp.linked_editing_range.enable, true, { client_id = client.id })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- enable type formatting which allows lsps to modify text while you're
|
-- enable type formatting which allows lsps to modify text while you're
|
||||||
-- typing for example if you insert {} in a string in python basedpyright
|
-- typing for example if you insert {} in a string in python basedpyright
|
||||||
-- will change the string to a format string
|
-- will change the string to a format string
|
||||||
if client:supports_method('textDocument/onTypeFormatting') then
|
if client:supports_method('textDocument/onTypeFormatting') then
|
||||||
vim.lsp.on_type_formatting.enable(true, { client_id = client.id })
|
pcall(vim.lsp.on_type_formatting.enable, true, { client_id = client.id })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user