From f8985d7aa263ce57e46b5cfdf3ca1a0bf95ea1f6 Mon Sep 17 00:00:00 2001 From: ray-x Date: Tue, 14 Jun 2022 08:56:49 +1000 Subject: [PATCH] allow skip lsp clients setup --- README.md | 2 ++ lua/navigator.lua | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c7497a..c816669 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,8 @@ require'navigator'.setup({ }, lsp_installer = false, -- set to true if you would like use the lsp installed by williamboman/nvim-lsp-installer lsp = { + enable = true, -- skip lsp setup if disabled make sure add require('navigator.lspclient.mapping').setup() in you + -- own on_attach code_action = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, code_lens_action = {enable = true, sign = true, sign_priority = 40, virtual_text = true}, format_on_save = true, -- set to false to disable lsp code format on save (if you are using prettier/efm/formater etc) diff --git a/lua/navigator.lua b/lua/navigator.lua index f8499f7..52f6db6 100755 --- a/lua/navigator.lua +++ b/lua/navigator.lua @@ -34,6 +34,7 @@ _NgConfigValues = { signature_help_cfg = { debug = false }, -- if you would like to init ray-x/lsp_signature plugin in navigator, pass in signature help ctags = { cmd = 'ctags', tagfile = '.tags' }, lsp = { + enable = true, -- if disabled make sure add require('navigator.lspclient.mapping').setup() in you on_attach code_action = { enable = true, sign = true, @@ -185,7 +186,7 @@ local extend_config = function(opts) if key == 'lsp' then local lsp = require('navigator.lspclient.clients').lsp if not vim.tbl_contains(lsp or {}, k) and k ~= 'efm' and k ~= 'null-ls' then - info(string.format('[] extend LSP support for %s ', k)) + info(string.format('[] extend LSP support for %s %s ', key, k)) end elseif key == 'keymaps' then info('keymap override') @@ -228,7 +229,9 @@ M.setup = function(cfg) require('navigator.implementation') cfg.lsp = cfg.lsp or _NgConfigValues.lsp - require('navigator.diagnostics').config(cfg.lsp.diagnostic) + if cfg.lsp.enable then + require('navigator.diagnostics').config(cfg.lsp.diagnostic) + end if not _NgConfigValues.loaded then _NgConfigValues.loaded = true end