From 23d53b5d7bc2f31eed672c0a8d26dc608fb6d0ba Mon Sep 17 00:00:00 2001 From: Ibrahim Muftee Date: Mon, 4 Aug 2025 07:45:42 -0500 Subject: feat(nvim) slim down new config --- dot_config/nvim_new/lsp/astro.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 dot_config/nvim_new/lsp/astro.lua (limited to 'dot_config/nvim_new/lsp/astro.lua') diff --git a/dot_config/nvim_new/lsp/astro.lua b/dot_config/nvim_new/lsp/astro.lua new file mode 100644 index 0000000..6f33439 --- /dev/null +++ b/dot_config/nvim_new/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, +} -- cgit v1.2.3