diff options
31 files changed, 120 insertions, 120 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f89c8426..3099bb85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,15 +18,15 @@ To preview the generated `README.md` locally, source `scripts/docgen.lua` from It **must** be run from the `.git`/project root. (TODO: try to find the `.git` root with one of our `util.*` functions?) -# skeleton +# configs -skeleton has a `__newindex` metamethod which validates and creates +configs has a `__newindex` metamethod which validates and creates an object containing `setup()`, which can then be retrieved and modified. In `vim.validate` parlance, this is the "spec": ``` -skeleton.SERVER_NAME = { +configs.SERVER_NAME = { default_config = {'t'}; on_new_config = {'f', true}; on_attach = {'f', true}; @@ -40,7 +40,7 @@ docs = { ``` - Keys of the `docs.default_config` table match those of - `skeleton.SERVER_NAME.default_config`, and can be used to specify custom + `configs.SERVER_NAME.default_config`, and can be used to specify custom documentation. This is useful for functions, whose docs cannot be easily auto-generated. - The `commands` object is a table of `name:definition` key:value pairs, where @@ -63,12 +63,12 @@ Example: ``` -After you create `skeleton.SERVER_NAME`, you may add arbitrary +After you create `configs.SERVER_NAME`, you may add arbitrary language-specific functions to it if necessary. Example: - skeleton.texlab.buf_build = buf_build + configs.texlab.buf_build = buf_build Finally, add a `require 'nvim_lsp/SERVER_NAME'` line to `lua/nvim_lsp.lua`. @@ -83,7 +83,7 @@ nvim_lsp.texlab.setup{ ### Example: custom config -To configure a custom/private server, just require `nvim_lsp/skeleton` and do +To configure a custom/private server, just require `nvim_lsp/configs` and do the same as we do if we were adding it to the repository itself. 1. Define the config: `configs.foo_lsp = { … }` @@ -91,7 +91,7 @@ the same as we do if we were adding it to the repository itself. ```lua local nvim_lsp = require'nvim_lsp' -local configs = require'nvim_lsp/skeleton' +local configs = require'nvim_lsp/configs' -- Check if it's already defined for when I reload this file. if not nvim_lsp.foo_lsp then configs.foo_lsp = { diff --git a/lua/nvim_lsp.lua b/lua/nvim_lsp.lua index 734e1175..42b8383b 100644 --- a/lua/nvim_lsp.lua +++ b/lua/nvim_lsp.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' require 'nvim_lsp/bashls' require 'nvim_lsp/ccls' @@ -32,12 +32,12 @@ local M = { } function M.available_servers() - return vim.tbl_keys(skeleton) + return vim.tbl_keys(configs) end function M.installable_servers() local res = {} - for k, v in pairs(skeleton) do + for k, v in pairs(configs) do if v.install then table.insert(res, k) end end return res @@ -50,17 +50,17 @@ function M._root._setup() M._root.commands = { LspInstall = { function(name) - local template = skeleton[name] - if not template then + local config = configs[name] + if not config then return print("Invalid server name:", name) end - if not template.install then + if not config.install then return print(name, "can't be automatically installed (yet)") end - if template.install_info().is_installed then + if config.install_info().is_installed then return print(name, "is already installed") end - template.install() + config.install() end; "-nargs=1"; "-complete=custom,v:lua.lsp_complete_installable_servers"; @@ -70,18 +70,18 @@ function M._root._setup() function(name) if name == nil then local res = {} - for k, v in pairs(skeleton) do + for k, v in pairs(configs) do if v.install_info then res[k] = v.install_info() end end return print(vim.inspect(res)) end - local template = skeleton[name] - if not template then + local config = configs[name] + if not config then return print("Invalid server name:", name) end - return print(vim.inspect(template.install_info())) + return print(vim.inspect(config.install_info())) end; "-nargs=?"; "-complete=custom,v:lua.lsp_complete_servers"; @@ -94,7 +94,7 @@ end local mt = {} function mt:__index(k) - return skeleton[k] + return configs[k] end return setmetatable(M, mt) diff --git a/lua/nvim_lsp/bashls.lua b/lua/nvim_lsp/bashls.lua index 318181bb..fa054b40 100644 --- a/lua/nvim_lsp/bashls.lua +++ b/lua/nvim_lsp/bashls.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = {bin_name}; } -skeleton[server_name] = { +configs[server_name] = { default_config = { cmd = {"bash-language-server", "start"}; filetypes = {"sh"}; @@ -43,6 +43,6 @@ Language server for bash, written using tree sitter in typescript. }; }; -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/ccls.lua b/lua/nvim_lsp/ccls.lua index ea15b813..14e1f62c 100644 --- a/lua/nvim_lsp/ccls.lua +++ b/lua/nvim_lsp/ccls.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.ccls = { +configs.ccls = { default_config = util.utf8_config { cmd = {"ccls"}; filetypes = {"c", "cpp", "objc", "objcpp"}; diff --git a/lua/nvim_lsp/clangd.lua b/lua/nvim_lsp/clangd.lua index 57cdbd7f..34207e5a 100644 --- a/lua/nvim_lsp/clangd.lua +++ b/lua/nvim_lsp/clangd.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.clangd = { +configs.clangd = { default_config = util.utf8_config { cmd = {"clangd", "--background-index"}; filetypes = {"c", "cpp", "objc", "objcpp"}; diff --git a/lua/nvim_lsp/skeleton.lua b/lua/nvim_lsp/configs.lua index 9c5b78c6..fa0ca2c2 100644 --- a/lua/nvim_lsp/skeleton.lua +++ b/lua/nvim_lsp/configs.lua @@ -2,19 +2,19 @@ local util = require 'nvim_lsp/util' local api, validate, lsp = vim.api, vim.validate, vim.lsp local tbl_extend = vim.tbl_extend -local skeleton = {} +local configs = {} -function skeleton.__newindex(t, template_name, template) +function configs.__newindex(t, config_name, config_definition) validate { - name = {template_name, 's'}; - default_config = {template.default_config, 't'}; - on_new_config = {template.on_new_config, 'f', true}; - on_attach = {template.on_attach, 'f', true}; - commands = {template.commands, 't', true}; + name = {config_name, 's'}; + default_config = {config_definition.default_config, 't'}; + on_new_config = {config_definition.on_new_config, 'f', true}; + on_attach = {config_definition.on_attach, 'f', true}; + commands = {config_definition.commands, 't', true}; } - if template.commands then - for k, v in pairs(template.commands) do + if config_definition.commands then + for k, v in pairs(config_definition.commands) do validate { ['command.name'] = {k, 's'}; ['command.fn'] = {v[1], 'f'}; @@ -24,7 +24,7 @@ function skeleton.__newindex(t, template_name, template) local M = {} - local default_config = tbl_extend("keep", template.default_config, { + local default_config = tbl_extend("keep", config_definition.default_config, { log_level = lsp.protocol.MessageType.Warning; settings = {}; init_options = {}; @@ -32,7 +32,7 @@ function skeleton.__newindex(t, template_name, template) }) -- Force this part. - default_config.name = template_name + default_config.name = config_name -- The config here is the one which will be instantiated for the new server, -- which is why this is a function, so that it can refer to the settings @@ -110,8 +110,8 @@ function skeleton.__newindex(t, template_name, template) }) add_callbacks(new_config) - if template.on_new_config then - pcall(template.on_new_config, new_config) + if config_definition.on_new_config then + pcall(config_definition.on_new_config, new_config) end if config.on_new_config then pcall(config.on_new_config, new_config) @@ -141,7 +141,7 @@ function skeleton.__newindex(t, template_name, template) api.nvim_command(string.format( "autocmd BufEnter <buffer=%d> ++once lua require'nvim_lsp'[%q]._setup_buffer(%d)" , bufnr - , template_name + , config_name , client.id )) end @@ -166,20 +166,20 @@ function skeleton.__newindex(t, template_name, template) if client.config._on_attach then client.config._on_attach(client) end - if template.commands then + if config_definition.commands then -- Create the module commands - util.create_module_commands(template_name, M.commands) + util.create_module_commands(config_name, M.commands) end end - M.commands = template.commands - M.name = template_name - M.template_config = template + M.commands = config_definition.commands + M.name = config_name + M.document_config = config_definition - rawset(t, template_name, M) + rawset(t, config_name, M) return M end -return setmetatable({}, skeleton) +return setmetatable({}, configs) -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/cssls.lua b/lua/nvim_lsp/cssls.lua index c39f81fd..fa6b29cf 100644 --- a/lua/nvim_lsp/cssls.lua +++ b/lua/nvim_lsp/cssls.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -13,7 +13,7 @@ local installer = util.npm_installer { local root_pattern = util.root_pattern("package.json") -skeleton[server_name] = { +configs[server_name] = { default_config = util.utf8_config { cmd = {bin_name, "--stdio"}; filetypes = {"css", "scss", "less"}; @@ -55,6 +55,6 @@ npm install -g vscode-css-languageserver-bin }; } -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/dockerls.lua b/lua/nvim_lsp/dockerls.lua index 7973312d..18b85615 100644 --- a/lua/nvim_lsp/dockerls.lua +++ b/lua/nvim_lsp/dockerls.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = {bin_name}; } -skeleton[server_name] = { +configs[server_name] = { default_config = { cmd = {bin_name, "--stdio"}; filetypes = {"Dockerfile", "dockerfile"}; @@ -45,6 +45,6 @@ npm install -g dockerfile-language-server-nodejs }; }; -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/elmls.lua b/lua/nvim_lsp/elmls.lua index 46799c4a..b29dadbf 100644 --- a/lua/nvim_lsp/elmls.lua +++ b/lua/nvim_lsp/elmls.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp local api = vim.api @@ -16,7 +16,7 @@ local default_capabilities = lsp.protocol.make_client_capabilities() default_capabilities.offsetEncoding = {"utf-8", "utf-16"} local elm_root_pattern = util.root_pattern("elm.json") -skeleton[server_name] = { +configs[server_name] = { default_config = util.utf8_config { cmd = {bin_name}; -- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now. @@ -70,7 +70,7 @@ npm install -g elm elm-test elm-format @elm-tooling/elm-language-server }; } -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/flow.lua b/lua/nvim_lsp/flow.lua index ba3f5102..e29b94ad 100644 --- a/lua/nvim_lsp/flow.lua +++ b/lua/nvim_lsp/flow.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.flow = { +configs.flow = { default_config = { cmd = {"npm", "run", "flow","lsp"}; filetypes = {"javascript", "javascriptreact", "javascript.jsx"}; diff --git a/lua/nvim_lsp/fortls.lua b/lua/nvim_lsp/fortls.lua index b4de1e78..d0b19f29 100644 --- a/lua/nvim_lsp/fortls.lua +++ b/lua/nvim_lsp/fortls.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.fortls = { +configs.fortls = { default_config = { cmd = {"fortls"}; filetypes = {"fortran"}; diff --git a/lua/nvim_lsp/ghcide.lua b/lua/nvim_lsp/ghcide.lua index 65d799a4..0aaf3a96 100644 --- a/lua/nvim_lsp/ghcide.lua +++ b/lua/nvim_lsp/ghcide.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.ghcide = { +configs.ghcide = { default_config = { cmd = { "ghcide", "--lsp" }; filetypes = { "haskell", "lhaskell" }; diff --git a/lua/nvim_lsp/gopls.lua b/lua/nvim_lsp/gopls.lua index 86f5e7be..655d7f33 100644 --- a/lua/nvim_lsp/gopls.lua +++ b/lua/nvim_lsp/gopls.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.gopls = { +configs.gopls = { default_config = { cmd = {"gopls"}; filetypes = {"go"}; diff --git a/lua/nvim_lsp/hie.lua b/lua/nvim_lsp/hie.lua index cb18a164..8747b486 100644 --- a/lua/nvim_lsp/hie.lua +++ b/lua/nvim_lsp/hie.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.hie = { +configs.hie = { default_config = { cmd = {"hie-wrapper"}; filetypes = {"haskell"}; diff --git a/lua/nvim_lsp/intelephense.lua b/lua/nvim_lsp/intelephense.lua index 3ea18491..8cdb5573 100644 --- a/lua/nvim_lsp/intelephense.lua +++ b/lua/nvim_lsp/intelephense.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = {bin_name}; } -skeleton[server_name] = { +configs[server_name] = { default_config = util.utf8_config { cmd = {bin_name, "--stdio"}; filetypes = {"php"}; @@ -67,6 +67,6 @@ npm install -g intelephense }; } -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/leanls.lua b/lua/nvim_lsp/leanls.lua index 77a045df..048be311 100644 --- a/lua/nvim_lsp/leanls.lua +++ b/lua/nvim_lsp/leanls.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.leanls = { +configs.leanls = { default_config = { cmd = {"lean-language-server", "--stdio"}; filetypes = {"lean"}; diff --git a/lua/nvim_lsp/ocamlls.lua b/lua/nvim_lsp/ocamlls.lua index 99b5697f..5bcce8d4 100644 --- a/lua/nvim_lsp/ocamlls.lua +++ b/lua/nvim_lsp/ocamlls.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = { bin_name }; } -skeleton[server_name] = { +configs[server_name] = { default_config = { cmd = { bin_name, "--stdio" }; filetypes = { "ocaml", "reason" }; @@ -43,6 +43,6 @@ npm install -g ocaml-langauge-server }; }; }; -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/pyls.lua b/lua/nvim_lsp/pyls.lua index 1d4c703c..15a5ac7e 100644 --- a/lua/nvim_lsp/pyls.lua +++ b/lua/nvim_lsp/pyls.lua @@ -1,7 +1,7 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local lsp = vim.lsp -skeleton.pyls = { +configs.pyls = { default_config = { cmd = {"pyls"}; filetypes = {"python"}; diff --git a/lua/nvim_lsp/pyls_ms.lua b/lua/nvim_lsp/pyls_ms.lua index 34c2e4a1..539d2995 100644 --- a/lua/nvim_lsp/pyls_ms.lua +++ b/lua/nvim_lsp/pyls_ms.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -76,7 +76,7 @@ end local installer = make_installer() -skeleton[name] = { +configs[name] = { default_config = { filetypes = {"python"}; @@ -133,5 +133,5 @@ This server accepts configuration via the `settings` key. }; }; -skeleton[name].install = installer.install -skeleton[name].install_info = installer.info +configs[name].install = installer.install +configs[name].install_info = installer.info diff --git a/lua/nvim_lsp/rls.lua b/lua/nvim_lsp/rls.lua index 98a8a09c..8383fb68 100644 --- a/lua/nvim_lsp/rls.lua +++ b/lua/nvim_lsp/rls.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.rls = { +configs.rls = { default_config = { cmd = {"rls"}; filetypes = {"rust"}; diff --git a/lua/nvim_lsp/rust_analyzer.lua b/lua/nvim_lsp/rust_analyzer.lua index 7d9ce36c..33e600b7 100644 --- a/lua/nvim_lsp/rust_analyzer.lua +++ b/lua/nvim_lsp/rust_analyzer.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.rust_analyzer = { +configs.rust_analyzer = { default_config = util.utf8_config { cmd = {"ra_lsp_server"}; filetypes = {"rust"}; diff --git a/lua/nvim_lsp/solargraph.lua b/lua/nvim_lsp/solargraph.lua index 547fa9c8..17ea2a0d 100644 --- a/lua/nvim_lsp/solargraph.lua +++ b/lua/nvim_lsp/solargraph.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.solargraph = { +configs.solargraph = { default_config = { cmd = {"solargraph", "stdio"}; filetypes = {"ruby"}; diff --git a/lua/nvim_lsp/sumneko_lua.lua b/lua/nvim_lsp/sumneko_lua.lua index 6da92a99..d60bb6d3 100644 --- a/lua/nvim_lsp/sumneko_lua.lua +++ b/lua/nvim_lsp/sumneko_lua.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local vim = vim @@ -92,7 +92,7 @@ end local installer = make_installer() -skeleton[name] = { +configs[name] = { default_config = { filetypes = {'lua'}; root_dir = function(fname) @@ -120,6 +120,6 @@ guide](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run). }; } -skeleton[name].install = installer.install -skeleton[name].install_info = installer.info +configs[name].install = installer.install +configs[name].install_info = installer.info -- vim:et ts=2 diff --git a/lua/nvim_lsp/terraformls.lua b/lua/nvim_lsp/terraformls.lua index a5914835..f8fcd7b7 100644 --- a/lua/nvim_lsp/terraformls.lua +++ b/lua/nvim_lsp/terraformls.lua @@ -1,8 +1,8 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp -skeleton.terraformls = { +configs.terraformls = { default_config = { cmd = {"terraform-lsp"}; filetypes = {"terraform"}; diff --git a/lua/nvim_lsp/texlab.lua b/lua/nvim_lsp/texlab.lua index 79ede52c..37021ee6 100644 --- a/lua/nvim_lsp/texlab.lua +++ b/lua/nvim_lsp/texlab.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -31,7 +31,7 @@ end -- end) -- end -skeleton.texlab = { +configs.texlab = { default_config = { cmd = {"texlab"}; filetypes = {"tex", "bib"}; @@ -86,5 +86,5 @@ See https://texlab.netlify.com/docs/reference/configuration for configuration op }; } -skeleton.texlab.buf_build = buf_build +configs.texlab.buf_build = buf_build -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/tsserver.lua b/lua/nvim_lsp/tsserver.lua index 75b8bb98..bd7440d7 100644 --- a/lua/nvim_lsp/tsserver.lua +++ b/lua/nvim_lsp/tsserver.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = {bin_name}; } -skeleton[server_name] = { +configs[server_name] = { default_config = util.utf8_config { cmd = {bin_name, "--stdio"}; filetypes = {"javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx"}; @@ -47,6 +47,6 @@ npm install -g typescript-language-server }; } -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/vimls.lua b/lua/nvim_lsp/vimls.lua index c16e4fdf..f5f19a53 100644 --- a/lua/nvim_lsp/vimls.lua +++ b/lua/nvim_lsp/vimls.lua @@ -1,4 +1,4 @@ -local skeleton = require "nvim_lsp/skeleton" +local configs = require "nvim_lsp/configs" local util = require "nvim_lsp/util" local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = {bin_name} } -skeleton[server_name] = { +configs[server_name] = { default_config = { cmd = {bin_name, "--stdio"}, filetypes = {"vim"}, @@ -57,7 +57,7 @@ npm install -g vim-language-server } } -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp/yamlls.lua b/lua/nvim_lsp/yamlls.lua index 2f0d0337..be3cbcdf 100644 --- a/lua/nvim_lsp/yamlls.lua +++ b/lua/nvim_lsp/yamlls.lua @@ -1,4 +1,4 @@ -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local lsp = vim.lsp @@ -11,7 +11,7 @@ local installer = util.npm_installer { binaries = {bin_name}; } -skeleton[server_name] = { +configs[server_name] = { default_config = util.utf8_config { cmd = {bin_name, "--stdio"}; filetypes = {"yaml"}; @@ -45,6 +45,6 @@ npm install -g yaml-language-server }; } -skeleton[server_name].install = installer.install -skeleton[server_name].install_info = installer.info +configs[server_name].install = installer.install +configs[server_name].install_info = installer.info -- vim:et ts=2 sw=2 diff --git a/scripts/README_template.md b/scripts/README_template.md index 1da876a9..8a0f8145 100644 --- a/scripts/README_template.md +++ b/scripts/README_template.md @@ -83,7 +83,7 @@ nvim_lsp.texlab.setup{ ### Example: custom config -To configure a custom/private server, just require `nvim_lsp/skeleton` and do +To configure a custom/private server, just require `nvim_lsp/configs` and do the same as we do if we were adding it to the repository itself. 1. Define the config: `configs.foo_lsp = { … }` @@ -91,7 +91,7 @@ the same as we do if we were adding it to the repository itself. ```lua local nvim_lsp = require'nvim_lsp' -local configs = require'nvim_lsp/skeleton' +local configs = require'nvim_lsp/configs' -- Check if it's already defined for when I reload this file. if not nvim_lsp.foo_lsp then configs.foo_lsp = { diff --git a/scripts/docgen.lua b/scripts/docgen.lua index 322945b2..bab341e2 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -1,5 +1,5 @@ require 'nvim_lsp' -local skeleton = require 'nvim_lsp/skeleton' +local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local inspect = vim.inspect local uv = vim.loop @@ -75,7 +75,7 @@ require'nvim_lsp'.{{template_name}}.setup{} ]] local function make_lsp_sections() - return make_section(0, '\n', sorted_map_table(skeleton, function(template_name, template_object) + return make_section(0, '\n', sorted_map_table(configs, function(template_name, template_object) local template_def = template_object.template_config local docs = template_def.docs @@ -222,7 +222,7 @@ local function make_lsp_sections() end local function make_implemented_servers_list() - return make_section(0, '\n', sorted_map_table(skeleton, function(k) + return make_section(0, '\n', sorted_map_table(configs, function(k) return template("- [{{server}}](#{{server}})", {server=k}) end)) end |
