Skip to content

Commit

Permalink
#179 and issue #177 lsp codelens enable
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Apr 24, 2022
1 parent 9ceeb41 commit 0c31d69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions lua/navigator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ _NgConfigValues = {
-- your on_attach will be called at end of navigator on_attach
end,
ts_fold = false,
-- code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true},
-- code_lens_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true},
treesitter_analysis = true, -- treesitter variable context
transparency = 50, -- 0 ~ 100 blur the main window, 100: fully transparent, 0: opaque, set to nil to disable it
lsp_signature_help = true, -- if you would like to hook ray-x/lsp_signature plugin in navigator
Expand Down Expand Up @@ -58,7 +56,6 @@ _NgConfigValues = {
format_on_save = true, -- set to false to disasble lsp code format on save (if you are using prettier/efm/formater etc)
disable_format_cap = {}, -- a list of lsp disable file format (e.g. if you using efm or vim-codeformat etc), empty by default
disable_lsp = {}, -- a list of lsp server disabled for your project, e.g. denols and tsserver you may
code_lens = false,
-- only want to enable one lsp server
disply_diagnostic_qf = true, -- always show quickfix if there are diagnostic errors
diagnostic_load_files = false, -- lsp diagnostic errors list may contains uri that not opened yet set to true
Expand Down Expand Up @@ -133,6 +130,10 @@ M.deprecated = function(cfg)
warn('disable_format_ft renamed to disable_format_cap')
end

if cfg.lsp ~= nil and cfg.lsp.code_lens == true then
warn('code_lens moved to lsp.code_lens_action')
end

if cfg.lspinstall ~= nil then
warn('lspinstall deprecated, please use lsp-installer instead or use "lspinstall" branch')
end
Expand Down
8 changes: 4 additions & 4 deletions lua/navigator/lspclient/clients.lua
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ local function setup(user_opts, cnt)
'windline',
}
for i = 1, #disable_ft do
if ft == disable_ft[i] or _LoadedFiletypes[ft] then
if ft == disable_ft[i] then
trace('navigator disabled for ft or it is loaded', ft)
return
end
Expand Down Expand Up @@ -789,12 +789,12 @@ local function setup(user_opts, cnt)

lsp_startup(ft, retry, lsp_opts)

--- if code line enabled
if _NgConfigValues.lsp.code_lens then
--- if code lens enabled
if _NgConfigValues.lsp.code_lens_action.enable then
require('navigator.codelens').setup()
end

-- _LoadedFiletypes[ft .. tostring(bufnr)] = true
-- _LoadedFiletypes[ft .. tostring(bufnr)] = true -- may prevent lsp config when reboot lsp
end

local function on_filetype()
Expand Down

0 comments on commit 0c31d69

Please sign in to comment.