feat: added signature and added go lsp

This commit is contained in:
Andre Henriques 2024-01-15 10:04:37 +00:00
parent 718caf540d
commit 24dcfbf118
3 changed files with 7 additions and 4 deletions

View File

@ -9,6 +9,7 @@
"fidget": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" }, "fidget": { "branch": "main", "commit": "3a93300c076109d86c7ce35ec67a8034ae6ba9db" },
"friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" }, "friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" },
"luasnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" }, "luasnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" },
"neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" }, "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },

View File

@ -2,9 +2,8 @@ function setup_attach()
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}), group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function (ev) callback = function (ev)
-- local lspconfig = require('lspconfig') -- local lspconfig = require('lspconfig')
--
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
local opts = { buffer = ev.buf } local opts = { buffer = ev.buf }
@ -81,6 +80,7 @@ return {
'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-cmdline',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
"ray-x/lsp_signature.nvim",
'luasnip', 'luasnip',
'fidget', 'fidget',
}, },
@ -116,13 +116,15 @@ return {
require('cmp_nvim_lsp').default_capabilities() 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 for _, server_name in ipairs(def_set_servers) do
lspconfig[server_name].setup({ lspconfig[server_name].setup({
capabilities = capabilities, capabilities = capabilities,
}) })
end end
require("lsp_signature").on_attach({bind = true})
end, end,
}, },

View File

@ -8,7 +8,7 @@ return {
require('nvim-treesitter.configs').setup({ require('nvim-treesitter.configs').setup({
ensure_installed = { ensure_installed = {
"lua", "svelte", "javascript", "typescript", "html", "elixir", "vim", "lua", "svelte", "javascript", "typescript", "html", "elixir", "vim",
"jsdoc", "jsdoc", "go",
}, },
auto_install = true, auto_install = true,