|
|
|
@ -185,7 +185,8 @@ local setups = {
|
|
|
|
|
},
|
|
|
|
|
filetypes = { 'c', 'cpp', 'objc', 'objcpp' },
|
|
|
|
|
on_attach = function(client, bufnr)
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = true
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = client.server_capabilities.documentFormattingProvider
|
|
|
|
|
or true
|
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
@ -208,7 +209,7 @@ local setups = {
|
|
|
|
|
sqls = {
|
|
|
|
|
filetypes = { 'sql' },
|
|
|
|
|
on_attach = function(client, bufnr)
|
|
|
|
|
client.server_capabilities.executeCommandProvider = true
|
|
|
|
|
client.server_capabilities.executeCommandProvider = client.server_capabilities.documentFormattingProvider or true
|
|
|
|
|
highlight.diagnositc_config_sign()
|
|
|
|
|
require('sqls').setup({ picker = 'telescope' }) -- or default
|
|
|
|
|
end,
|
|
|
|
@ -546,7 +547,12 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
|
if config.combined_attach == nil then
|
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = enable_fmt
|
|
|
|
|
if enable_fmt then
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = client.server_capabilities.documentFormattingProvider
|
|
|
|
|
or enable_fmt
|
|
|
|
|
else
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if config.combined_attach == 'mine' then
|
|
|
|
@ -555,7 +561,12 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
|
end
|
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = enable_fmt
|
|
|
|
|
if enable_fmt then
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = client.server_capabilities.documentFormattingProvider
|
|
|
|
|
or enable_fmt
|
|
|
|
|
else
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
|
end
|
|
|
|
|
require('navigator.lspclient.mapping').setup({
|
|
|
|
|
client = client,
|
|
|
|
|
bufnr = bufnr,
|
|
|
|
@ -567,7 +578,12 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = enable_fmt
|
|
|
|
|
if enable_fmt then
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = client.server_capabilities.documentFormattingProvider
|
|
|
|
|
or enable_fmt
|
|
|
|
|
else
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
|
end
|
|
|
|
|
require('navigator.lspclient.mapping').setup({
|
|
|
|
|
client = client,
|
|
|
|
|
bufnr = bufnr,
|
|
|
|
@ -577,7 +593,13 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
|
end
|
|
|
|
|
if config.combined_attach == 'both' then
|
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = enable_fmt
|
|
|
|
|
if enable_fmt then
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = client.server_capabilities.documentFormattingProvider
|
|
|
|
|
or enable_fmt
|
|
|
|
|
else
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if config.on_attach and type(config.on_attach) == 'function' then
|
|
|
|
|
config.on_attach(client, bufnr)
|
|
|
|
|
end
|
|
|
|
@ -605,7 +627,13 @@ local function lsp_startup(ft, retry, user_lsp_opts)
|
|
|
|
|
else
|
|
|
|
|
cfg.on_attach = function(client, bufnr)
|
|
|
|
|
on_attach(client, bufnr)
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = enable_fmt
|
|
|
|
|
|
|
|
|
|
if enable_fmt then
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = client.server_capabilities.documentFormattingProvider
|
|
|
|
|
or enable_fmt
|
|
|
|
|
else
|
|
|
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|