1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 21:50:05 +08:00
SpaceVim/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/svelte.lua

32 lines
992 B
Lua
Raw Normal View History

local util = require 'lspconfig.util'
2021-10-05 15:13:10 +08:00
local bin_name = 'svelteserver'
local cmd = { bin_name, '--stdio' }
2021-10-05 15:13:10 +08:00
if vim.fn.has 'win32' == 1 then
cmd = { 'cmd.exe', '/C', bin_name, '--stdio' }
2021-10-05 15:13:10 +08:00
end
return {
2021-10-05 15:13:10 +08:00
default_config = {
cmd = cmd,
2021-10-05 15:13:10 +08:00
filetypes = { 'svelte' },
root_dir = util.root_pattern('package.json', '.git'),
},
docs = {
description = [[
https://github.com/sveltejs/language-tools/tree/master/packages/language-server
2022-07-24 16:14:35 +08:00
Note: assuming that [tsserver](#tsserver) is setup, full JavaScript/TypeScript support (find references, rename, etc of symbols in Svelte files when working in JS/TS files) requires per-project installation and configuration of [typescript-svelte-plugin](https://github.com/sveltejs/language-tools/tree/master/packages/typescript-plugin#usage).
2021-10-05 15:13:10 +08:00
`svelte-language-server` can be installed via `npm`:
```sh
npm install -g svelte-language-server
```
]],
default_config = {
root_dir = [[root_pattern("package.json", ".git")]],
},
},
}