We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6d31b1 commit c36916fCopy full SHA for c36916f
lsp/svelte.lua
@@ -12,7 +12,14 @@
12
return {
13
cmd = { 'svelteserver', '--stdio' },
14
filetypes = { 'svelte' },
15
- root_markers = { 'package.json', '.git' },
+ root_dir = function(bufnr, on_dir)
16
+ local root_files = { 'package.json', '.git' }
17
+ local fname = vim.api.nvim_buf_get_name(bufnr)
18
+ -- Svelte LSP only supports file:// schema. https://github.com/sveltejs/language-tools/issues/2777
19
+ if vim.uv.fs_stat(fname) ~= nil then
20
+ on_dir(vim.fs.dirname(vim.fs.find(root_files, { path = fname, upward = true })[1]))
21
+ end
22
+ end,
23
on_attach = function(client, bufnr)
24
vim.api.nvim_buf_create_user_command(bufnr, 'LspMigrateToSvelte5', function()
25
client:exec_cmd({
0 commit comments