aboutsummaryrefslogtreecommitdiff
path: root/.config/vis/plugins/vis-lspc/supported-servers.lua
blob: 0cfe1fd68a494a098b4d1959a834da570a4b1f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
-- Copyright (c) 2022 Florian Fischer. All rights reserved.
--
-- This file is part of vis-lspc.
--
-- vis-lspc is free software: you can redistribute it and/or modify it under the
-- terms of the GNU General Public License as published by the Free Software
-- Foundation, either version 3 of the License, or (at your option) any later
-- version.
--
-- vis-lspc is distributed in the hope that it will be useful, but WITHOUT ANY
-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License along with
-- vis-lspc found in the LICENSE file. If not, see <https://www.gnu.org/licenses/>.
--
-- List of supported and preconfigured language server implementations
local source_str = debug.getinfo(1, 'S').source:sub(2)
local source_path = source_str:match('(.*/)')

local lspc = dofile(source_path .. 'lspc.lua')

local clangd = {
  name = 'clangd',
  cmd = 'clangd',
  roots = {'compile_commands.json', '.clangd'},
}
local typescript = {
  name = 'typescript',
  cmd = 'typescript-language-server --stdio',
  roots = {'package.json', 'tsconfig.json', 'jsconfig.json'},
}

return {
  c = clangd,
  cpp = clangd,
  ansi_c = clangd,
  -- pylsp (python-lsp-server) language server configuration
  -- https://github.com/python-lsp/python-lsp-server
  python = {
    name = 'python-lsp-server',
    cmd = 'pylsp',
    roots = {'requirements.txt', 'setup.py'},
  },
  -- lua (lua-language-server) language server configuration
  -- https://github.com/sumneko/lua-language-server
  lua = {
    name = 'lua-language-server',
    cmd = 'lua-language-server',
    settings = {
      Lua = {diagnostics = {globals = {'vis'}}, telemetry = {enable = false}},
    },
  },
  -- typescript (typescript-language-server) language server configuration
  -- https://github.com/typescript-language-server/typescript-language-server
  javascript = typescript,
  typescript = typescript,
  -- dart language server configuration
  -- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md
  dart = {
    name = 'dart',
    cmd = 'dart language-server --client-id vis-lspc --client-version ' .. lspc.version,
    roots = {'pubspec.yaml'},
  },
  -- haskell (haskell-language-server)
  -- https://github.com/haskell/haskell-language-server
  haskell = {
    name = 'haskell',
    cmd = 'haskell-language-server-wrapper --lsp',
    roots = {'hie.yaml', 'cabal.project', 'Setup.hs', 'stack.yaml', '*.cabal'},
  },

  -- ocaml (ocaml-language-server)
  -- https://github.com/ocaml/ocaml-lsp
  caml = {
    name = 'ocaml',
    cmd = 'ocamllsp',
    roots = {
      'dune-workspace',
      'dune-project',
      'Makefile',
      'opam',
      '*.opam',
      'esy.json',
      'dune',
    },
  },

  -- go (gopls)
  -- https://github.com/golang/tools/tree/master/gopls
  go = {name = 'go', cmd = 'gopls', roots = {'Gopkg.toml', 'go.mod'}},

  -- bash (bash-language-server)
  -- https://github.com/bash-lsp/bash-language-server
  bash = {name = 'bash-language-server', cmd = 'bash-language-server start'},

  -- html (html-language-server)
  -- https://github.com/hrsh7th/vscode-langservers-extracted
  html = {
    name = 'html-language-server',
    cmd = 'vscode-html-language-server --stdio',
  },

  -- css (css-language-server)
  -- https://github.com/hrsh7th/vscode-langservers-extracted
  css = {
    name = 'css-language-server',
    cmd = 'vscode-css-language-server --stdio',
  },

  -- json (json-language-server)
  -- https://github.com/hrsh7th/vscode-langservers-extracted
  json = {
    name = 'json-language-server',
    cmd = 'vscode-json-language-server --stdio',
  },

  -- rust (rust-analyzer)
  -- https://github.com/rust-lang/rust-analyzer
  rust = {name = 'rust', cmd = 'rust-analyzer', roots = {'Cargo.toml'}},
}