From 9c7c46855c4df6a4b63363b3079b768068f372ca Mon Sep 17 00:00:00 2001 From: Squibid Date: Tue, 2 Sep 2025 21:58:57 -0400 Subject: [PATCH] protect calls to lsp/wtf funcs as most of them are only on dev builds atm --- lua/core/lsp/wtf.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/core/lsp/wtf.lua b/lua/core/lsp/wtf.lua index 308789d..b92c9d5 100644 --- a/lua/core/lsp/wtf.lua +++ b/lua/core/lsp/wtf.lua @@ -16,21 +16,21 @@ auto('LspAttach', { -- highlight color codes via lsp (supported by cssls) -- #ff0000 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 -- enable linked editing this allows lsps to modify things like html tags -- for example when you change

to

will be changed by the lsp -- to 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 -- enable type formatting which allows lsps to modify text while you're -- typing for example if you insert {} in a string in python basedpyright -- will change the string to a format string 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 })