vis-config

lua scripts to configure vis editor

git clone https://9o.is/git/vis-config.git

supported-servers.lua

(3906B)


      1 -- Copyright (c) 2022 Florian Fischer. All rights reserved.
      2 --
      3 -- This file is part of vis-lspc.
      4 --
      5 -- vis-lspc is free software: you can redistribute it and/or modify it under the
      6 -- terms of the GNU General Public License as published by the Free Software
      7 -- Foundation, either version 3 of the License, or (at your option) any later
      8 -- version.
      9 --
     10 -- vis-lspc is distributed in the hope that it will be useful, but WITHOUT ANY
     11 -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     12 -- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
     13 --
     14 -- You should have received a copy of the GNU General Public License along with
     15 -- vis-lspc found in the LICENSE file. If not, see <https://www.gnu.org/licenses/>.
     16 --
     17 -- List of supported and preconfigured language server implementations
     18 local source_str = debug.getinfo(1, 'S').source:sub(2)
     19 local source_path = source_str:match('(.*/)')
     20 
     21 local lspc = dofile(source_path .. 'lspc.lua')
     22 
     23 local clangd = {
     24   name = 'clangd',
     25   cmd = 'clangd',
     26   roots = {'compile_commands.json', '.clangd'},
     27 }
     28 local typescript = {
     29   name = 'typescript',
     30   cmd = 'typescript-language-server --stdio',
     31   roots = {'package.json', 'tsconfig.json', 'jsconfig.json'},
     32 }
     33 
     34 return {
     35   c = clangd,
     36   cpp = clangd,
     37   ansi_c = clangd,
     38   -- pylsp (python-lsp-server) language server configuration
     39   -- https://github.com/python-lsp/python-lsp-server
     40   python = {
     41     name = 'python-lsp-server',
     42     cmd = 'pylsp',
     43     roots = {'requirements.txt', 'setup.py'},
     44   },
     45   -- lua (lua-language-server) language server configuration
     46   -- https://github.com/sumneko/lua-language-server
     47   lua = {
     48     name = 'lua-language-server',
     49     cmd = 'lua-language-server',
     50     settings = {
     51       Lua = {diagnostics = {globals = {'vis'}}, telemetry = {enable = false}},
     52     },
     53   },
     54   -- typescript (typescript-language-server) language server configuration
     55   -- https://github.com/typescript-language-server/typescript-language-server
     56   javascript = typescript,
     57   typescript = typescript,
     58   -- dart language server configuration
     59   -- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md
     60   dart = {
     61     name = 'dart',
     62     cmd = 'dart language-server --client-id vis-lspc --client-version ' .. lspc.version,
     63     roots = {'pubspec.yaml'},
     64   },
     65   -- haskell (haskell-language-server)
     66   -- https://github.com/haskell/haskell-language-server
     67   haskell = {
     68     name = 'haskell',
     69     cmd = 'haskell-language-server-wrapper --lsp',
     70     roots = {'hie.yaml', 'cabal.project', 'Setup.hs', 'stack.yaml', '*.cabal'},
     71   },
     72 
     73   -- ocaml (ocaml-language-server)
     74   -- https://github.com/ocaml/ocaml-lsp
     75   caml = {
     76     name = 'ocaml',
     77     cmd = 'ocamllsp',
     78     roots = {
     79       'dune-workspace',
     80       'dune-project',
     81       'Makefile',
     82       'opam',
     83       '*.opam',
     84       'esy.json',
     85       'dune',
     86     },
     87   },
     88 
     89   -- go (gopls)
     90   -- https://github.com/golang/tools/tree/master/gopls
     91   go = {name = 'go', cmd = 'gopls', roots = {'Gopkg.toml', 'go.mod'}},
     92 
     93   -- bash (bash-language-server)
     94   -- https://github.com/bash-lsp/bash-language-server
     95   bash = {name = 'bash-language-server', cmd = 'bash-language-server start'},
     96 
     97   -- html (html-language-server)
     98   -- https://github.com/hrsh7th/vscode-langservers-extracted
     99   html = {
    100     name = 'html-language-server',
    101     cmd = 'vscode-html-language-server --stdio',
    102   },
    103 
    104   -- css (css-language-server)
    105   -- https://github.com/hrsh7th/vscode-langservers-extracted
    106   css = {
    107     name = 'css-language-server',
    108     cmd = 'vscode-css-language-server --stdio',
    109   },
    110 
    111   -- json (json-language-server)
    112   -- https://github.com/hrsh7th/vscode-langservers-extracted
    113   json = {
    114     name = 'json-language-server',
    115     cmd = 'vscode-json-language-server --stdio',
    116   },
    117 
    118   -- rust (rust-analyzer)
    119   -- https://github.com/rust-lang/rust-analyzer
    120   rust = {name = 'rust', cmd = 'rust-analyzer', roots = {'Cargo.toml'}},
    121 }