diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2020-02-02 19:20:32 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-02 19:20:32 -0800 |
| commit | 0c6188364f8f13fb8713f778e14a63c2e0517000 (patch) | |
| tree | f532f792466940a304aa7d5db501cba8f024fea9 /scripts | |
| parent | jsonls (vscode-json-languageserver) #85 (diff) | |
| parent | [docgen] Update README.md (diff) | |
| download | nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.tar nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.tar.gz nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.tar.bz2 nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.tar.lz nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.tar.xz nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.tar.zst nvim-lspconfig-0c6188364f8f13fb8713f778e14a63c2e0517000.zip | |
Merge #111 from neovim/docgen
docgen.lua: require() all configs
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/README_template.md | 6 | ||||
| -rw-r--r-- | scripts/docgen.lua | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/scripts/README_template.md b/scripts/README_template.md index 044fd4b3..98c9aa4e 100644 --- a/scripts/README_template.md +++ b/scripts/README_template.md @@ -14,11 +14,11 @@ Update Nvim and nvim-lsp before reporting an issue. There are many language servers in the world, and not enough time. Help us create configs for *all the LSPs!* -0. Read [CONTRIBUTING.md](CONTRIBUTING.md) for instructions. +1. Read [CONTRIBUTING.md](CONTRIBUTING.md) for instructions. Ask questions in [Neovim Gitter](https://gitter.im/neovim/neovim). -1. Choose a language from [the coc.nvim wiki](https://github.com/neoclide/coc.nvim/wiki/Language-servers) or +2. Choose a language from [the coc.nvim wiki](https://github.com/neoclide/coc.nvim/wiki/Language-servers) or [the emacs-lsp project](https://github.com/emacs-lsp/lsp-mode#supported-languages). -2. Create a new file at `lua/nvim_lsp/SERVER_NAME.lua`. See +3. Create a new file at `lua/nvim_lsp/SERVER_NAME.lua`. See [existing configs](https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/) for examples (`lua/nvim_lsp/texlab.lua` is an extensive example). diff --git a/scripts/docgen.lua b/scripts/docgen.lua index bedadba4..3e753972 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -74,7 +74,16 @@ require'nvim_lsp'.{{template_name}}.setup{} ``` ]] +local function require_all_configs() + -- Configs are lazy-loaded, tickle them to populate the `configs` singleton. + for _,v in ipairs(vim.fn.glob('lua/nvim_lsp/*.lua', 1, 1)) do + local module_name = v:gsub('.*/', ''):gsub('%.lua$', '') + require('nvim_lsp/'..module_name) + end +end + local function make_lsp_sections() + require_all_configs() return make_section(0, '\n', sorted_map_table(configs, function(template_name, template_object) local template_def = template_object.document_config local docs = template_def.docs |
