mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
feat(extras): added extra for svelte. Full support will be enabled once my mason PR gets merged
This commit is contained in:
parent
4e62df4269
commit
7598a7503d
1 changed files with 52 additions and 0 deletions
52
lua/lazyvim/plugins/extras/lang/svelte.lua
Normal file
52
lua/lazyvim/plugins/extras/lang/svelte.lua
Normal file
|
@ -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,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue