diff options
| author | Vito G. Graffagnino <vito@graffagnino.xyz> | 2022-07-22 10:37:14 +0100 |
|---|---|---|
| committer | Vito G. Graffagnino <vito@graffagnino.xyz> | 2022-07-22 10:37:14 +0100 |
| commit | f6e0aff4356dc2598966657895c777e6bea23d54 (patch) | |
| tree | b7ab1692faa0882b4bc12d685b0e2bca036aa654 /lua/user/lsp/handlers.lua | |
| parent | 1afd76ff2fa2d7cfb408a78cd8e47209f0305a24 (diff) | |
Changes to create unbreakable IDE part 1 from chris@machine
Diffstat (limited to 'lua/user/lsp/handlers.lua')
| -rw-r--r-- | lua/user/lsp/handlers.lua | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua index 5792a74..fc5d7d3 100644 --- a/lua/user/lsp/handlers.lua +++ b/lua/user/lsp/handlers.lua @@ -45,19 +45,25 @@ M.setup = function() end local function lsp_highlight_document(client) - -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then - vim.api.nvim_exec( - [[ - augroup lsp_document_highlight - autocmd! * <buffer> - autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight() - autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references() - augroup END - ]], - false - ) + -- if client.server_capabilities.document_highlight then + local status_ok, illuminate = pcall(require, "illuminate") + if not status_ok then + return end + illuminate.on_attach(client) + -- -- Set autocommands conditional on server_capabilities + -- if client.resolved_capabilities.document_highlight then + -- vim.api.nvim_exec( + -- [[ + -- augroup lsp_document_highlight + -- autocmd! * <buffer> + -- autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight() + -- autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references() + -- augroup END + -- ]], + -- false + -- ) + -- end end local function lsp_keymaps(bufnr) @@ -80,6 +86,9 @@ local function lsp_keymaps(bufnr) end M.on_attach = function(client, bufnr) + if client.name == "sumneko_lua" then + client.resolved_capabilities.document_formatting = false + end if client.name == "tsserver" then client.resolved_capabilities.document_formatting = false end |
