nvim: replace signature help
This commit is contained in:
parent
cc34940c06
commit
8557936586
|
@ -45,7 +45,6 @@ if cmp and luasnip then
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{ name = 'nvim_lsp_signature_help' },
|
|
||||||
}, {
|
}, {
|
||||||
{ name = 'buffer' },
|
{ name = 'buffer' },
|
||||||
})
|
})
|
||||||
|
|
|
@ -53,38 +53,47 @@ local on_attach = function(client, bufnr)
|
||||||
vim.bo.formatoptions = vim.o.formatoptions:gsub('t', '')
|
vim.bo.formatoptions = vim.o.formatoptions:gsub('t', '')
|
||||||
-- Let LSP autoformat on save
|
-- Let LSP autoformat on save
|
||||||
require('lsp-format').on_attach(client)
|
require('lsp-format').on_attach(client)
|
||||||
|
|
||||||
|
-- virtual text hint for parameters
|
||||||
|
require ('lsp_signature').on_attach({
|
||||||
|
bind = true,
|
||||||
|
handler_opts = {
|
||||||
|
border = 'rounded'
|
||||||
|
},
|
||||||
|
floating_window = false
|
||||||
|
}, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- -- show help on hover -- cursor ends up in popup
|
-- show help on hover -- cursor ends up in popup
|
||||||
-- if client.resolved_capabilities.hover then
|
if client.resolved_capabilities.hover then
|
||||||
-- vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
-- group = 'config_lsp',
|
group = 'config_lsp',
|
||||||
-- buffer = bufnr,
|
buffer = bufnr,
|
||||||
-- callback = function()
|
callback = function()
|
||||||
-- vim.lsp.buf.hover({ focusable = false })
|
vim.lsp.buf.hover({ focusable = false })
|
||||||
-- end
|
end
|
||||||
-- })
|
})
|
||||||
-- end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- update client capabilities with completion plugin stuff
|
-- update client capabilities with completion plugin stuff
|
||||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(
|
local capabilities = require('cmp_nvim_lsp').update_capabilities(
|
||||||
vim.lsp.protocol.make_client_capabilities())
|
vim.lsp.protocol.make_client_capabilities())
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||||
vim.lsp.handlers.hover, {
|
vim.lsp.handlers.hover, {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
width = 60,
|
width = 60,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- setup servers
|
-- setup servers
|
||||||
if vim.fn.executable('clangd') > 0 then
|
if vim.fn.executable('clangd') > 0 then
|
||||||
require'lspconfig'.clangd.setup{
|
require 'lspconfig'.clangd.setup {
|
||||||
cmd = {
|
cmd = {
|
||||||
'clangd',
|
'clangd',
|
||||||
'--compile-commands-dir=build',
|
'--compile-commands-dir=build',
|
||||||
'--clang-tidy', -- needs >=clangd-9
|
'--clang-tidy', -- needs >=clangd-9
|
||||||
'--ranking-model=decision_forest' -- needs >=clangd-12
|
'--ranking-model=decision_forest' -- needs >=clangd-12
|
||||||
},
|
},
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
|
@ -92,17 +101,17 @@ if vim.fn.executable('clangd') > 0 then
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('lua-language-server') > 0 then
|
if vim.fn.executable('lua-language-server') > 0 then
|
||||||
require'lspconfig'.sumneko_lua.setup {
|
require 'lspconfig'.sumneko_lua.setup({
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = {
|
runtime = {
|
||||||
version = 'LuaJIT',
|
version = 'LuaJIT',
|
||||||
},
|
},
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = {'vim'},
|
globals = { 'vim' },
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
library = vim.api.nvim_get_runtime_file("", true),
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
},
|
},
|
||||||
telemetry = {
|
telemetry = {
|
||||||
enable = false,
|
enable = false,
|
||||||
|
@ -115,56 +124,56 @@ if vim.fn.executable('lua-language-server') > 0 then
|
||||||
},
|
},
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('pylsp') > 0 then
|
if vim.fn.executable('pylsp') > 0 then
|
||||||
require'lspconfig'.pylsp.setup{
|
require 'lspconfig'.pylsp.setup({
|
||||||
settings = {
|
settings = {
|
||||||
pylsp = {
|
pylsp = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('lemminx') > 0 then
|
if vim.fn.executable('lemminx') > 0 then
|
||||||
require'lspconfig'.lemminx.setup{
|
require 'lspconfig'.lemminx.setup({
|
||||||
filetypes = {
|
filetypes = {
|
||||||
'xml', 'xsd', 'xsl', 'xslt', 'svg', 'gentoo-metadata'
|
'xml', 'xsd', 'xsl', 'xslt', 'svg', 'gentoo-metadata'
|
||||||
},
|
},
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('vscode-html-language-server') > 0 then
|
if vim.fn.executable('vscode-html-language-server') > 0 then
|
||||||
require'lspconfig'.html.setup{
|
require 'lspconfig'.html.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('vscode-css-language-server') > 0 then
|
if vim.fn.executable('vscode-css-language-server') > 0 then
|
||||||
require'lspconfig'.cssls.setup{
|
require 'lspconfig'.cssls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('vscode-eslint-language-server') > 0 then
|
if vim.fn.executable('vscode-eslint-language-server') > 0 then
|
||||||
require'lspconfig'.eslint.setup{
|
require 'lspconfig'.eslint.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.fn.executable('vscode-json-language-server') > 0 then
|
if vim.fn.executable('vscode-json-language-server') > 0 then
|
||||||
require'lspconfig'.jsonls.setup{
|
require 'lspconfig'.jsonls.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lsp-format").setup({
|
require("lsp-format").setup({
|
||||||
|
|
|
@ -48,7 +48,6 @@ require('packer').startup(function(use)
|
||||||
requires = 'https://github.com/L3MON4D3/LuaSnip'
|
requires = 'https://github.com/L3MON4D3/LuaSnip'
|
||||||
},
|
},
|
||||||
'https://github.com/hrsh7th/cmp-nvim-lua',
|
'https://github.com/hrsh7th/cmp-nvim-lua',
|
||||||
'https://github.com/hrsh7th/cmp-nvim-lsp-signature-help',
|
|
||||||
'https://github.com/uga-rosa/cmp-dictionary',
|
'https://github.com/uga-rosa/cmp-dictionary',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +62,7 @@ require('packer').startup(function(use)
|
||||||
'https://github.com/lukas-reineke/lsp-format.nvim',
|
'https://github.com/lukas-reineke/lsp-format.nvim',
|
||||||
tag = '*'
|
tag = '*'
|
||||||
}
|
}
|
||||||
|
use { 'https://github.com/ray-x/lsp_signature.nvim' }
|
||||||
|
|
||||||
-- tools
|
-- tools
|
||||||
use {
|
use {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user