mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 23:30:03 +08:00
33 lines
750 B
Lua
33 lines
750 B
Lua
|
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")]],
|
||
|
},
|
||
|
},
|
||
|
}
|