diff options
| author | William Boman <william@redwill.se> | 2023-01-24 16:15:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-24 23:15:34 +0800 |
| commit | 4caceb90cb39f1d811089cab3074e039b64e4d3d (patch) | |
| tree | 5834a9af931b8933881c824586710a611cd3fb21 /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.tar nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.tar.gz nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.tar.bz2 nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.tar.lz nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.tar.xz nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.tar.zst nvim-lspconfig-4caceb90cb39f1d811089cab3074e039b64e4d3d.zip | |
feat: add vtsls (#2419)
* feat: add vtsls
* fix: format
Co-authored-by: Raphael <glephunter@gmail.com>
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/server_configurations/vtsls.lua | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/vtsls.lua b/lua/lspconfig/server_configurations/vtsls.lua new file mode 100644 index 00000000..29f7c642 --- /dev/null +++ b/lua/lspconfig/server_configurations/vtsls.lua @@ -0,0 +1,45 @@ +local util = require 'lspconfig.util' + +local cmd = { 'vtsls', '--stdio' } + +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', unpack(cmd) } +end + +return { + default_config = { + cmd = cmd, + filetypes = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + }, + root_dir = function(fname) + return util.root_pattern 'tsconfig.json'(fname) + or util.root_pattern('package.json', 'jsconfig.json', '.git')(fname) + end, + single_file_support = true, + }, + docs = { + description = [[ +https://github.com/yioneko/vtsls + +`vtsls` can be installed with npm: +```sh +npm install -g @vtsls/language-server +``` + +To configure a Typescript project, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) +or [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to +the root of your project. +``` +]], + default_config = { + root_dir = [[root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git")]], + }, + }, +} |
