From 07151b8be50130cb3784da727673c0182f73d18f Mon Sep 17 00:00:00 2001 From: Piero Lescano Date: Sat, 16 Apr 2022 21:25:25 -0500 Subject: feat: add astro-ls support (#1841) --- lua/lspconfig/server_configurations/astro.lua | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lua/lspconfig/server_configurations/astro.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/astro.lua b/lua/lspconfig/server_configurations/astro.lua new file mode 100644 index 00000000..61d5d301 --- /dev/null +++ b/lua/lspconfig/server_configurations/astro.lua @@ -0,0 +1,32 @@ +local util = require 'lspconfig.util' + +local bin_name = 'astro-ls' +local cmd = { bin_name, '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', bin_name, '--stdio' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'astro' }, + root_dir = util.root_pattern('package.json', 'tsconfig.json', 'jsconfig.json', '.git'), + init_options = { + configuration = {}, + }, + }, + docs = { + description = [[ +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 +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], + }, + }, +} -- cgit v1.2.3-70-g09d2