Skip to content

Mini.completion with mini.snippets enabled throws error with svelte language server. #2008

@231tr0n

Description

@231tr0n

Contributing guidelines

Module(s)

mini.completion, mini.snippets

Neovim version

0.11.x

Description

I came across this error when using mini.completion and mini.snippets with svelte language server.

Image

Reproduction

  1. Make sure to have nodejs, npm and svelte-language-server installed. I use arch btw 😏 in WSL2, so with arch using yay yay -Syu --noconfirm svelte-language-server nodejs-lts npm does the job.
  2. Below is the config to use to reproduce the issue.
-- Clone latest 'mini.nvim' (requires Git CLI installed)
vim.cmd('echo "Installing `mini.nvim`" | redraw')
local mini_path = vim.fn.stdpath("data") .. "/site/pack/deps/start/mini.nvim"
local clone_cmd = { "git", "clone", "--depth=1", "https://github.com/nvim-mini/mini.nvim", mini_path }
vim.fn.system(clone_cmd)
vim.cmd('echo "`mini.nvim` is installed" | redraw')

-- Make sure 'mini.nvim' is available
vim.cmd("packadd mini.nvim")
require("mini.deps").setup()
require("mini.snippets").setup()
require("mini.completion").setup()

MiniDeps.add("neovim/nvim-lspconfig")

local lsp_servers = {
	svelte = {
		settings = {
			typescript = {
				inlayHints = {
					parameterNames = { enabled = "all" },
					parameterTypes = { enabled = true },
					variableTypes = { enabled = true },
					propertyDeclarationTypes = { enabled = true },
					functionLikeReturnTypes = { enabled = true },
					enumMemberValues = { enabled = true },
				},
			},
		},
	},
}

vim.lsp.config("*", {
	capabilities = lsp_capabilities,
	root_markers = { ".git" },
})
for server, config in pairs(lsp_servers) do
	vim.lsp.config(server, config)
	vim.lsp.enable(server)
end
  1. Clone this repo https://github.com/231tr0n/231tr0n.github.io.git.
  2. Navigate into the git root directory.
  3. Run npm install to install all packages. This step is necessary for the svelte language server to work, as it does not seem to work properly without installing all the packages.
  4. Run NVIM_APPNAME=repro nvim -- src/routes/+layout.svelte.
  5. Go to line number 5 and press o to create a new line 6.
  6. Type import ass and press Ctrl-n to select the first element in the completion menu named asset and press Enter to get the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions