|
|
@ -527,11 +527,29 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
|
|
|
|
require('navigator.lspclient.mapping').setup({
|
|
|
|
|
|
|
|
client = client,
|
|
|
|
|
|
|
|
bufnr = bufnr,
|
|
|
|
|
|
|
|
cap = capabilities,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
if config.combined_attach == 'their' then
|
|
|
|
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
|
|
|
|
require('navigator.lspclient.mapping').setup({
|
|
|
|
|
|
|
|
client = client,
|
|
|
|
|
|
|
|
bufnr = bufnr,
|
|
|
|
|
|
|
|
cap = capabilities,
|
|
|
|
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if config.combined_attach == 'both' then
|
|
|
|
if config.combined_attach == 'both' then
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
if config.on_attach then
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
|
|
|
|
if config.on_attach and type(config.on_attach) == 'function' then
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if setups[lspclient] and setups[lspclient].on_attach then
|
|
|
|
if setups[lspclient] and setups[lspclient].on_attach then
|
|
|
@ -539,7 +557,11 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
require('navigator.lspclient.mapping').setup({
|
|
|
|
|
|
|
|
client = client,
|
|
|
|
|
|
|
|
bufnr = bufnr,
|
|
|
|
|
|
|
|
cap = capabilities,
|
|
|
|
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
cfg.on_init = function(client)
|
|
|
|
cfg.on_init = function(client)
|
|
|
@ -552,11 +574,9 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if disable_fmt then
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
client.resolved_capabilities.document_formatting = enable_fmt
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|