diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-08-01 17:45:29 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-08-01 17:47:59 +0200 |
| commit | 8e90351411d0312493c56d59058785d11b282145 (patch) | |
| tree | b3d52a87ec9ee4a789abd3c983ec1b741283a00c | |
| parent | 5b933613cc741026263825e8ae79876d19643239 (diff) | |
| download | vis-lspc-8e90351411d0312493c56d59058785d11b282145.tar.gz vis-lspc-8e90351411d0312493c56d59058785d11b282145.zip | |
move server configurations into a seperate file
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | init.lua | 14 | ||||
| -rw-r--r-- | supported-servers.lua | 15 |
3 files changed, 20 insertions, 15 deletions
@@ -113,12 +113,12 @@ vis-lspc is in a early state, but if you are brave there are some default key bi lspc-hover - hover over the current line lspc-show-diagnostics - show the available diagnostics of the current line -### Available configuration fields +### Available configuration options The module table returned by `require('plugins/vis-lspc')` can be use to configure some aspects of vis-lspc. -Available fields are: +Available options are: * `name = 'vis-lspc'` - the name vis-lspc introduces itself to a language server * `logging = false` - enable logging only useful for debugging vis-lspc @@ -154,6 +154,8 @@ command line flag](https://microsoft.github.io/language-server-protocol/specific -- map of known language servers per syntax lspc.ls_map = {cpp = clangd, ansi_c = clangd} +Language servers configured in vis-lspc can be found in `supported_servers.lua`. + ## License All code except otherwise noted is licensed under the term of GPL-3. @@ -227,20 +227,8 @@ local function syntax_to_languageId(syntax) return syntax end --- clangd language server configuration -local clangd = {name = 'clangd', cmd = 'clangd'} - -- map of known language servers per syntax -lspc.ls_map = { - 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'}, - -- lua (lua-language-server) language server configuration - -- https://github.com/sumneko/lua-language-server - lua = {name = 'lua-language-server', cmd = 'lua-language-server'}, -} +lspc.ls_map = dofile(source_path .. 'supported-servers.lua') -- return the name of the language server for this syntax local function get_ls_name_for_syntax(syntax) diff --git a/supported-servers.lua b/supported-servers.lua new file mode 100644 index 0000000..8535fc4 --- /dev/null +++ b/supported-servers.lua @@ -0,0 +1,15 @@ +-- Copyright (c) 2022 Florian Fischer. All rights reserved. +-- Use of this source code is governed by a MIT license found in the LICENSE file. +-- List of supported and preconfigured language server implementations +local clangd = {name = 'clangd', cmd = 'clangd'} + +return { + 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'}, + -- lua (lua-language-server) language server configuration + -- https://github.com/sumneko/lua-language-server + lua = {name = 'lua-language-server', cmd = 'lua-language-server'}, +} |
