feat(extras): added extra for svelte. Full support will be enabled once my mason PR gets merged
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "svelte",
|
||||
root = {
|
||||
"svelte.config.js",
|
||||
"svelte.config.mjs",
|
||||
"svelte.config.cjs",
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
-- depends on the typescript extra
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "svelte" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- LSP Servers
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
svelte = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure tsserver plugin
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function(_, opts)
|
||||
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||
{
|
||||
name = "typescript-svelte-plugin",
|
||||
location = LazyVim.get_pkg_path(
|
||||
"svelte-language-server",
|
||||
"/node_modules/typescript-svelte-plugin",
|
||||
{ warn = false }
|
||||
),
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user