summaryrefslogtreecommitdiff
path: root/nvim/lsp/astro.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lsp/astro.lua')
-rwxr-xr-xnvim/lsp/astro.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/nvim/lsp/astro.lua b/nvim/lsp/astro.lua
new file mode 100755
index 0000000..6f33439
--- /dev/null
+++ b/nvim/lsp/astro.lua
@@ -0,0 +1,24 @@
+---@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
+--- ```
+
+local util = require 'lspconfig.util'
+
+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 = util.get_typescript_server_path(config.root_dir)
+ end
+ end,
+}