fix(nvim): lsp complete requires a snippet engine

This commit is contained in:
Tine 2024-02-29 10:48:46 +01:00
parent a23d047548
commit 38b4cdc78e
Signed by: mentos1386
SSH key fingerprint: SHA256:MNtTsLbihYaWF8j1fkOHfkKNlnN1JQfxEU/rBU8nCGw
3 changed files with 8 additions and 4 deletions

View file

@ -63,6 +63,9 @@
# Lua # Lua
stylua stylua
# Services
flyctl
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage

View file

@ -42,6 +42,8 @@ Plug("hrsh7th/cmp-path")
Plug("hrsh7th/nvim-cmp") Plug("hrsh7th/nvim-cmp")
Plug("onsails/lspkind.nvim") Plug("onsails/lspkind.nvim")
Plug("folke/trouble.nvim") Plug("folke/trouble.nvim")
Plug("hrsh7th/vim-vsnip")
Plug("hrsh7th/vim-vsnip-integ")
vim.call("plug#end") vim.call("plug#end")

View file

@ -45,7 +45,7 @@ cmp.setup({
snippet = { snippet = {
-- REQUIRED - you must specify a snippet engine -- REQUIRED - you must specify a snippet engine
expand = function(args) expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
@ -137,8 +137,7 @@ require("mason-lspconfig").setup({
"docker_compose_language_service", -- docker-compose "docker_compose_language_service", -- docker-compose
"eslint", -- eslint "eslint", -- eslint
"elixirls", -- elixir "elixirls", -- elixir
"golangci_lint_ls", -- golangci-lint "gopls", -- golang
"gopls", -- gopls
"graphql", -- graphql "graphql", -- graphql
"html", -- html "html", -- html
"htmx", -- htmx "htmx", -- htmx
@ -160,7 +159,7 @@ require("mason-lspconfig").setup({
}) })
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers({
function(server_name) -- default handler (optional) function(server_name)
require("lspconfig")[server_name].setup({ require("lspconfig")[server_name].setup({
capabilities = require("cmp_nvim_lsp").default_capabilities(), capabilities = require("cmp_nvim_lsp").default_capabilities(),
}) })