aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-08-01 17:45:29 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2022-08-01 17:47:59 +0200
commit8e90351411d0312493c56d59058785d11b282145 (patch)
treeb3d52a87ec9ee4a789abd3c983ec1b741283a00c
parent5b933613cc741026263825e8ae79876d19643239 (diff)
downloadvis-lspc-8e90351411d0312493c56d59058785d11b282145.tar.gz
vis-lspc-8e90351411d0312493c56d59058785d11b282145.zip
move server configurations into a seperate file
-rw-r--r--README.md6
-rw-r--r--init.lua14
-rw-r--r--supported-servers.lua15
3 files changed, 20 insertions, 15 deletions
diff --git a/README.md b/README.md
index b700bb8..290df0e 100644
--- a/README.md
+++ b/README.md
@@ -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.
diff --git a/init.lua b/init.lua
index 299620d..a6dd4c1 100644
--- a/init.lua
+++ b/init.lua
@@ -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'},
+}