2024-05-30 11:17:21 +02:00
|
|
|
return {
|
|
|
|
recommended = function()
|
|
|
|
return LazyVim.extras.wants({
|
|
|
|
ft = "astro",
|
|
|
|
root = {
|
2024-06-23 16:19:47 -04:00
|
|
|
-- https://docs.astro.build/en/guides/configuring-astro/#supported-config-file-types
|
2024-05-30 11:17:21 +02:00
|
|
|
"astro.config.js",
|
|
|
|
"astro.config.mjs",
|
|
|
|
"astro.config.cjs",
|
2024-06-23 16:19:47 -04:00
|
|
|
"astro.config.ts",
|
2024-05-30 11:17:21 +02:00
|
|
|
},
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
|
2024-06-01 08:33:24 +02:00
|
|
|
-- depends on the typescript extra
|
|
|
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
|
|
|
|
2024-05-30 11:17:21 +02:00
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2024-09-18 14:22:05 +08:00
|
|
|
opts = { ensure_installed = { "astro", "css" } },
|
2024-05-30 11:17:21 +02:00
|
|
|
},
|
|
|
|
|
2024-06-01 08:33:24 +02:00
|
|
|
-- LSP Servers
|
2024-05-30 11:17:21 +02:00
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
|
|
|
opts = {
|
|
|
|
servers = {
|
|
|
|
astro = {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-06-01 08:33:24 +02:00
|
|
|
|
|
|
|
-- Configure tsserver plugin
|
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
|
|
|
opts = function(_, opts)
|
|
|
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
|
|
|
{
|
|
|
|
name = "@astrojs/ts-plugin",
|
2024-06-05 11:09:12 +02:00
|
|
|
location = LazyVim.get_pkg_path("astro-language-server", "/node_modules/@astrojs/ts-plugin"),
|
2024-06-01 08:33:24 +02:00
|
|
|
enableForWorkspaceTypeScriptVersions = true,
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
},
|
2024-06-07 23:01:14 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
"conform.nvim",
|
|
|
|
opts = function(_, opts)
|
|
|
|
if LazyVim.has_extra("formatting.prettier") then
|
|
|
|
opts.formatters_by_ft = opts.formatters_by_ft or {}
|
|
|
|
opts.formatters_by_ft.astro = { "prettier" }
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
},
|
2024-05-30 11:17:21 +02:00
|
|
|
}
|