This commit is contained in:
Belal Elsabbagh
2025-07-12 19:20:04 +03:00
parent e1f8357d14
commit 4a42fd1467
3 changed files with 24 additions and 1 deletions

View File

@@ -149,4 +149,5 @@ vim.lsp.enable {
'rust-analyzer',
'tsls',
'yamlls',
'astrols',
}

View File

@@ -0,0 +1,22 @@
---@brief
---
--- https://github.com/withastro/language-tools/tree/main/packages/language-server
---
--- `astro-ls` can be installed via `npm`:
--- ```sh
--- npm install -g @astrojs/language-server
--- ```
return {
cmd = { 'astro-ls', '--stdio' },
filetypes = { 'astro' },
root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json', '.git' },
init_options = {
typescript = {},
},
before_init = function(_, config)
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
config.init_options.typescript.tsdk = 'node_modules/typescript/lib'
end
end,
}

View File

@@ -20,7 +20,7 @@ return {
},
formatters_by_ft = {
lua = { 'stylua' },
astro = { 'prettier' },
go = { 'gofmt' },
python = { 'ruff' },
javascript = { 'biome', 'prettier', stop_after_first = true },