diff options
author | Chris <[email protected]> | 2021-07-28 19:13:07 -0400 |
---|---|---|
committer | Chris <[email protected]> | 2021-07-28 19:13:07 -0400 |
commit | 3ee44cb3938a331b8534809300c6dd8114c0e5d8 (patch) | |
tree | 8cf9a4d9e39953c352fd226720556d37a893fbdd /lua/lsp/init.lua | |
parent | e2f7cce3c537d8bdbd68e6021f9f7574bf7efea4 (diff) |
service was a good idea, thank you tasty
Diffstat (limited to 'lua/lsp/init.lua')
-rw-r--r-- | lua/lsp/init.lua | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index ba22b931..f606e1d8 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -1,4 +1,5 @@ local utils = require "utils" +local service = require "lsp.service" local lsp_config = {} function lsp_config.config() @@ -13,18 +14,10 @@ function lsp_config.config() } end -local function no_formatter_on_attach(client, bufnr) - if lvim.lsp.on_attach_callback then - lvim.lsp.on_attach_callback(client, bufnr) - end - require("lsp.utils").lsp_highlight_document(client) - client.resolved_capabilities.document_formatting = false -end - function lsp_config.setup(lang) local lang_server = lvim.lang[lang].lsp local provider = lang_server.provider - if require("utils").check_lsp_client_active(provider) then + if utils.check_lsp_client_active(provider) then return end @@ -49,13 +42,13 @@ function lsp_config.setup(lang) if utils.is_table(method) then if utils.has_value(method, format_method) then - lang_server.setup.on_attach = no_formatter_on_attach + lang_server.setup.on_attach = service.no_formatter_on_attach end end if utils.is_string(method) then if method == format_method then - lang_server.setup.on_attach = no_formatter_on_attach + lang_server.setup.on_attach = service.no_formatter_on_attach end end end |