From 24dcfbf118c1de3f1694dffd10419cbb4a432a8c Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Mon, 15 Jan 2024 10:04:37 +0000 Subject: [PATCH] feat: added signature and added go lsp --- lazy-lock.json | 1 + lua/andr3/plugins/lsp.lua | 8 +++++--- lua/andr3/plugins/utils.lua | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 0c02672..40fce80 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,6 +9,7 @@ "fidget": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, "friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" }, "luasnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" }, "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, diff --git a/lua/andr3/plugins/lsp.lua b/lua/andr3/plugins/lsp.lua index b8e6875..788abc7 100644 --- a/lua/andr3/plugins/lsp.lua +++ b/lua/andr3/plugins/lsp.lua @@ -2,9 +2,8 @@ function setup_attach() vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('UserLspConfig', {}), callback = function (ev) - -- local lspconfig = require('lspconfig') - + -- vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' local opts = { buffer = ev.buf } @@ -81,6 +80,7 @@ return { 'hrsh7th/cmp-cmdline', 'hrsh7th/nvim-cmp', 'saadparwaiz1/cmp_luasnip', + "ray-x/lsp_signature.nvim", 'luasnip', 'fidget', }, @@ -116,13 +116,15 @@ return { require('cmp_nvim_lsp').default_capabilities() ) - local def_set_servers = { "tsserver", "svelte" } + local def_set_servers = { "tsserver", "svelte", "zls", "gopls" } for _, server_name in ipairs(def_set_servers) do lspconfig[server_name].setup({ capabilities = capabilities, }) end + + require("lsp_signature").on_attach({bind = true}) end, }, diff --git a/lua/andr3/plugins/utils.lua b/lua/andr3/plugins/utils.lua index d8ede0a..95701a8 100644 --- a/lua/andr3/plugins/utils.lua +++ b/lua/andr3/plugins/utils.lua @@ -8,7 +8,7 @@ return { require('nvim-treesitter.configs').setup({ ensure_installed = { "lua", "svelte", "javascript", "typescript", "html", "elixir", "vim", - "jsdoc", + "jsdoc", "go", }, auto_install = true,