This commit is contained in:
2026-05-15 21:10:42 +03:00
parent 15091b4efb
commit 3a0b8f5fc6
7 changed files with 316 additions and 40 deletions

View File

@@ -13,6 +13,21 @@
return {
cmd = { 'svelteserver', '--stdio' },
filetypes = { 'svelte' },
settings = {
typescript = {
inlayHints = {
parameterNames = {
enabled = 'literals',
suppressWhenArgumentMatchesName = true,
},
parameterTypes = { enabled = true },
variableTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
functionLikeReturnTypes = { enabled = true },
enumMemberValues = { enabled = true },
},
},
},
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
-- Svelte LSP only supports file:// schema. https://github.com/sveltejs/language-tools/issues/2777
@@ -32,6 +47,7 @@ return {
group = vim.api.nvim_create_augroup('lspconfig.svelte', {}),
callback = function(ctx)
-- internal API to sync changes that have not yet been saved to the file system
---@diagnostic disable-next-line: param-type-mismatch
client:notify('$/onDidChangeTsOrJsFile', { uri = ctx.match })
end,
})