nvim: add function signatures
This commit is contained in:
@@ -86,6 +86,8 @@ return require('packer').startup(function(use)
|
|||||||
config = function() require('plugins.nvim-lspconfig-conf') end,
|
config = function() require('plugins.nvim-lspconfig-conf') end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
use 'ray-x/lsp_signature.nvim'
|
||||||
|
|
||||||
-- Snippets
|
-- Snippets
|
||||||
use({
|
use({
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
|
|||||||
@@ -21,14 +21,23 @@ require("nvim-lsp-installer").setup({
|
|||||||
|
|
||||||
local lsp = require('lspconfig')
|
local lsp = require('lspconfig')
|
||||||
local navic = require('nvim-navic') -- breadcrumbs
|
local navic = require('nvim-navic') -- breadcrumbs
|
||||||
|
local sig = require('lsp_signature') -- function signatures
|
||||||
|
|
||||||
|
function my_attach (client, bufnr)
|
||||||
|
navic.attach(client, bufnr) -- breadcrumbs
|
||||||
|
sig.on_attach({
|
||||||
|
floating_window = false,
|
||||||
|
hint_prefix = ""
|
||||||
|
}, bufnr) -- function signatures
|
||||||
|
end
|
||||||
|
|
||||||
-- Normal LSPs
|
-- Normal LSPs
|
||||||
-- Install with `:LSPInstall`
|
-- Install with `:LSPInstall`
|
||||||
local servers = { "pylsp", "sumneko_lua", "clangd" }
|
local servers = { "pylsp", "clangd" }
|
||||||
for _, i in ipairs(servers) do
|
for _, i in ipairs(servers) do
|
||||||
lsp[i].setup({
|
lsp[i].setup({
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
navic.attach(client, bufnr) -- breadcrumbs
|
my_attach(client, bufnr)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -38,7 +47,7 @@ end
|
|||||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/texlab.lua
|
-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/texlab.lua
|
||||||
lsp.texlab.setup({
|
lsp.texlab.setup({
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
navic.attach(client, bufnr) -- breadcrumbs
|
my_attach(client, bufnr)
|
||||||
end,
|
end,
|
||||||
settings = {
|
settings = {
|
||||||
cmd = { 'texlab' },
|
cmd = { 'texlab' },
|
||||||
@@ -64,7 +73,7 @@ local opts = {
|
|||||||
},
|
},
|
||||||
server = { -- these settings go directly to lsp
|
server = { -- these settings go directly to lsp
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
navic.attach(client, bufnr) -- breadcrumbs
|
my_attach(client, bufnr)
|
||||||
end,
|
end,
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user