diff options
| author | Ashkan Kiani <ashkan.k.kiani@gmail.com> | 2019-11-14 01:07:09 -0800 |
|---|---|---|
| committer | Ashkan Kiani <ashkan.k.kiani@gmail.com> | 2019-11-14 01:07:09 -0800 |
| commit | 9666b63a70e28b1eef084489a44ea4b4bb4ae65a (patch) | |
| tree | 5870a50d5bce771ca0cde5ae0fe5eba52aa14fdf | |
| parent | Fix README links. (diff) | |
| download | nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.tar nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.tar.gz nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.tar.bz2 nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.tar.lz nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.tar.xz nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.tar.zst nvim-lspconfig-9666b63a70e28b1eef084489a44ea4b4bb4ae65a.zip | |
Rename to nvim_lsp and nvim-lsp.
| -rw-r--r-- | CONTRIBUTING.md | 4 | ||||
| -rw-r--r-- | README.md | 62 | ||||
| -rw-r--r-- | README_preamble.md | 56 | ||||
| -rw-r--r-- | autoload/common_lsp.vim | 12 | ||||
| -rw-r--r-- | autoload/nvim_lsp.vim | 12 | ||||
| -rw-r--r-- | lua/common_lsp.lua | 16 | ||||
| -rw-r--r-- | lua/nvim_lsp.lua | 16 | ||||
| -rw-r--r-- | lua/nvim_lsp/clangd.lua (renamed from lua/common_lsp/clangd.lua) | 4 | ||||
| -rw-r--r-- | lua/nvim_lsp/gopls.lua (renamed from lua/common_lsp/gopls.lua) | 4 | ||||
| -rw-r--r-- | lua/nvim_lsp/skeleton.lua (renamed from lua/common_lsp/skeleton.lua) | 6 | ||||
| -rw-r--r-- | lua/nvim_lsp/texlab.lua (renamed from lua/common_lsp/texlab.lua) | 4 | ||||
| -rw-r--r-- | lua/nvim_lsp/util.lua (renamed from lua/common_lsp/util.lua) | 2 | ||||
| -rw-r--r-- | scripts/docgen.lua | 6 |
13 files changed, 102 insertions, 102 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5d632a9..407eba7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,7 @@ Example: skeleton.texlab.buf_build = buf_build ``` -After you create a skeleton, you have to `require 'common_lsp/SERVER_NAME'` in -`lua/common_lsp.lua`, and that's it. +After you create a skeleton, you have to `require 'nvim_lsp/SERVER_NAME'` in +`lua/nvim_lsp.lua`, and that's it. Generate docs and you're done. @@ -14,9 +14,9 @@ things as much as you want in addition to the defaults that this provides. **CONTRIBUTIONS ARE WELCOME!** There's a lot of language servers in the world, and not enough time. See -[`lua/common_lsp/texlab.lua`](https://github.com/neovim/nvim-lsp/blob/master/lua/common_lsp/texlab.lua) +[`lua/nvim_lsp/texlab.lua`](https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/texlab.lua) and -[`lua/common_lsp/skeleton.lua`](https://github.com/neovim/nvim-lsp/blob/master/lua/common_lsp/skeleton.lua) +[`lua/nvim_lsp/skeleton.lua`](https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/skeleton.lua) for examples and ask me questions in the [Neovim Gitter](https://gitter.im/neovim/neovim) to help me complete configurations for *all the LSPs!* @@ -26,11 +26,11 @@ implemented from [this excellent list compiled by the coc.nvim contributors](https://github.com/neoclide/coc.nvim/wiki/Language-servers) or [this other excellent list from the emacs lsp-mode contributors](https://github.com/emacs-lsp/lsp-mode#supported-languages) -and create a new file under `lua/common_lsp/SERVER_NAME.lua`. +and create a new file under `lua/nvim_lsp/SERVER_NAME.lua`. - For a simple server which should only ever have one instance for the entire -neovim lifetime, I recommend copying `lua/common_lsp/texlab.lua`. +neovim lifetime, I recommend copying `lua/nvim_lsp/texlab.lua`. - For servers which should have a different instance for each project root, I -recommend copying `lua/common_lsp/gopls.lua`. +recommend copying `lua/nvim_lsp/gopls.lua`. ## Progress @@ -55,22 +55,22 @@ In progress: From vim: ```vim -call common_lsp#texlab({}) -call common_lsp#gopls({}) +call nvim_lsp#texlab({}) +call nvim_lsp#gopls({}) " These are still TODO, but will be done. -call common_lsp#clangd({}) -call common_lsp#ccls({}) -call common_lsp#tsserver({}) +call nvim_lsp#clangd({}) +call nvim_lsp#ccls({}) +call nvim_lsp#tsserver({}) " Or using a dynamic name. -call common_lsp#setup("texlab", {}) -call common_lsp#setup("gopls", {}) +call nvim_lsp#setup("texlab", {}) +call nvim_lsp#setup("gopls", {}) ``` From Lua: ```lua -require 'common_lsp'.texlab.setup { +require 'nvim_lsp'.texlab.setup { name = "texlab_fancy"; log_level = vim.lsp.protocol.MessageType.Log; settings = { @@ -82,15 +82,15 @@ require 'common_lsp'.texlab.setup { } } -local common_lsp = require 'common_lsp' +local nvim_lsp = require 'nvim_lsp' -- Customize how to find the root_dir -common_lsp.gopls.setup { - root_dir = common_lsp.util.root_pattern(".git"); +nvim_lsp.gopls.setup { + root_dir = nvim_lsp.util.root_pattern(".git"); } -- Build the current buffer. -require 'common_lsp'.texlab.buf_build(0) +require 'nvim_lsp'.texlab.buf_build(0) ``` ``` @@ -98,12 +98,12 @@ These are functions to set up servers more easily with some server specific defaults and more server specific things like commands or different diagnostics. -Servers may define extra functions on the `common_lsp.SERVER` table, e.g. -`common_lsp.texlab.buf_build({bufnr})`. +Servers may define extra functions on the `nvim_lsp.SERVER` table, e.g. +`nvim_lsp.texlab.buf_build({bufnr})`. The main setup signature will be: -common_lsp.SERVER.setup({config}) +nvim_lsp.SERVER.setup({config}) {config} is the same as |vim.lsp.start_client()|, but with some additions and changes: @@ -121,14 +121,14 @@ common_lsp.SERVER.setup({config}) If nil is returned, the buffer is skipped. - See |common_lsp.util.search_ancestors()| and the functions which use it: - - |common_lsp.util.root_pattern(patterns...)| finds an ancestor which + See |nvim_lsp.util.search_ancestors()| and the functions which use it: + - |nvim_lsp.util.root_pattern(patterns...)| finds an ancestor which - contains one of the files in `patterns...`. This is equivalent to coc.nvim's "rootPatterns" - More specific utilities: - - |common_lsp.util.find_git_root()| - - |common_lsp.util.find_node_modules_root()| - - |common_lsp.util.find_package_json_root()| + - |nvim_lsp.util.find_git_root()| + - |nvim_lsp.util.find_node_modules_root()| + - |nvim_lsp.util.find_package_json_root()| {name} Defaults to the server's name. @@ -174,8 +174,8 @@ as compile_commands.json or, for simpler projects, a compile_flags.txt. -common_lsp.clangd.setup({config}) -common_lsp#setup("clangd", {config}) +nvim_lsp.clangd.setup({config}) +nvim_lsp#setup("clangd", {config}) ``` Default Values: @@ -195,8 +195,8 @@ A completion engine built from scratch for (la)tex. -common_lsp.texlab.setup({config}) -common_lsp#setup("texlab", {config}) +nvim_lsp.texlab.setup({config}) +nvim_lsp#setup("texlab", {config}) ``` Commands: @@ -225,8 +225,8 @@ Google's lsp server for golang. -common_lsp.gopls.setup({config}) -common_lsp#setup("gopls", {config}) +nvim_lsp.gopls.setup({config}) +nvim_lsp#setup("gopls", {config}) ``` Default Values: diff --git a/README_preamble.md b/README_preamble.md index dcd318cb..2f01a844 100644 --- a/README_preamble.md +++ b/README_preamble.md @@ -14,9 +14,9 @@ things as much as you want in addition to the defaults that this provides. **CONTRIBUTIONS ARE WELCOME!** There's a lot of language servers in the world, and not enough time. See -[`lua/common_lsp/texlab.lua`](https://github.com/norcalli/nvim-common-lsp/blob/master/lua/common_lsp/texlab.lua) +[`lua/nvim_lsp/texlab.lua`](https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/texlab.lua) and -[`lua/common_lsp/skeleton.lua`](https://github.com/norcalli/nvim-common-lsp/blob/master/lua/common_lsp/skeleton.lua) +[`lua/nvim_lsp/skeleton.lua`](https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/skeleton.lua) for examples and ask me questions in the [Neovim Gitter](https://gitter.im/neovim/neovim) to help me complete configurations for *all the LSPs!* @@ -26,17 +26,17 @@ implemented from [this excellent list compiled by the coc.nvim contributors](https://github.com/neoclide/coc.nvim/wiki/Language-servers) or [this other excellent list from the emacs lsp-mode contributors](https://github.com/emacs-lsp/lsp-mode#supported-languages) -and create a new file under `lua/common_lsp/SERVER_NAME.lua`. +and create a new file under `lua/nvim_lsp/SERVER_NAME.lua`. - For a simple server which should only ever have one instance for the entire -neovim lifetime, I recommend copying `lua/common_lsp/texlab.lua`. +neovim lifetime, I recommend copying `lua/nvim_lsp/texlab.lua`. - For servers which should have a different instance for each project root, I -recommend copying `lua/common_lsp/gopls.lua`. +recommend copying `lua/nvim_lsp/gopls.lua`. ## Progress Implemented: -- [gopls](https://github.com/norcalli/nvim-common-lsp#gopls) (has some errors) -- [texlab](https://github.com/norcalli/nvim-common-lsp#texlab) +- [gopls](https://github.com/neovim/nvim-lsp#gopls) (has some errors) +- [texlab](https://github.com/neovim/nvim-lsp#texlab) Planned servers to implement (by me, but contributions welcome anyway): - [clangd](https://clang.llvm.org/extra/clangd/Installation.html) @@ -49,28 +49,28 @@ In progress: ## Install -`Plug 'norcalli/nvim-common-lsp'` +`Plug 'neovim/nvim-lsp'` ## Use From vim: ```vim -call common_lsp#texlab({}) -call common_lsp#gopls({}) +call nvim_lsp#texlab({}) +call nvim_lsp#gopls({}) " These are still TODO, but will be done. -call common_lsp#clangd({}) -call common_lsp#ccls({}) -call common_lsp#tsserver({}) +call nvim_lsp#clangd({}) +call nvim_lsp#ccls({}) +call nvim_lsp#tsserver({}) " Or using a dynamic name. -call common_lsp#setup("texlab", {}) -call common_lsp#setup("gopls", {}) +call nvim_lsp#setup("texlab", {}) +call nvim_lsp#setup("gopls", {}) ``` From Lua: ```lua -require 'common_lsp'.texlab.setup { +require 'nvim_lsp'.texlab.setup { name = "texlab_fancy"; log_level = vim.lsp.protocol.MessageType.Log; settings = { @@ -82,15 +82,15 @@ require 'common_lsp'.texlab.setup { } } -local common_lsp = require 'common_lsp' +local nvim_lsp = require 'nvim_lsp' -- Customize how to find the root_dir -common_lsp.gopls.setup { - root_dir = common_lsp.util.root_pattern(".git"); +nvim_lsp.gopls.setup { + root_dir = nvim_lsp.util.root_pattern(".git"); } -- Build the current buffer. -require 'common_lsp'.texlab.buf_build(0) +require 'nvim_lsp'.texlab.buf_build(0) ``` ``` @@ -98,12 +98,12 @@ These are functions to set up servers more easily with some server specific defaults and more server specific things like commands or different diagnostics. -Servers may define extra functions on the `common_lsp.SERVER` table, e.g. -`common_lsp.texlab.buf_build({bufnr})`. +Servers may define extra functions on the `nvim_lsp.SERVER` table, e.g. +`nvim_lsp.texlab.buf_build({bufnr})`. The main setup signature will be: -common_lsp.SERVER.setup({config}) +nvim_lsp.SERVER.setup({config}) {config} is the same as |vim.lsp.start_client()|, but with some additions and changes: @@ -121,14 +121,14 @@ common_lsp.SERVER.setup({config}) If nil is returned, the buffer is skipped. - See |common_lsp.util.search_ancestors()| and the functions which use it: - - |common_lsp.util.root_pattern(patterns...)| finds an ancestor which + See |nvim_lsp.util.search_ancestors()| and the functions which use it: + - |nvim_lsp.util.root_pattern(patterns...)| finds an ancestor which - contains one of the files in `patterns...`. This is equivalent to coc.nvim's "rootPatterns" - More specific utilities: - - |common_lsp.util.find_git_root()| - - |common_lsp.util.find_node_modules_root()| - - |common_lsp.util.find_package_json_root()| + - |nvim_lsp.util.find_git_root()| + - |nvim_lsp.util.find_node_modules_root()| + - |nvim_lsp.util.find_package_json_root()| {name} Defaults to the server's name. diff --git a/autoload/common_lsp.vim b/autoload/common_lsp.vim deleted file mode 100644 index 9d3444d3..00000000 --- a/autoload/common_lsp.vim +++ /dev/null @@ -1,12 +0,0 @@ -function! common_lsp#setup(name, config) - return luaeval("require'common_lsp'[_A[1]].setup(_A[2])", [a:name, a:config]) -endfunction - -" function! common_lsp#texlab(config) -" call common_lsp#setup("texlab", a:config) -" endfunction - -" function! common_lsp#gopls(config) -" call common_lsp#setup("gopls", a:config) -" endfunction - diff --git a/autoload/nvim_lsp.vim b/autoload/nvim_lsp.vim new file mode 100644 index 00000000..61bea51b --- /dev/null +++ b/autoload/nvim_lsp.vim @@ -0,0 +1,12 @@ +function! nvim_lsp#setup(name, config) + return luaeval("require'nvim_lsp'[_A[1]].setup(_A[2])", [a:name, a:config]) +endfunction + +" function! nvim_lsp#texlab(config) +" call nvim_lsp#setup("texlab", a:config) +" endfunction + +" function! nvim_lsp#gopls(config) +" call nvim_lsp#setup("gopls", a:config) +" endfunction + diff --git a/lua/common_lsp.lua b/lua/common_lsp.lua deleted file mode 100644 index 4dea8e1e..00000000 --- a/lua/common_lsp.lua +++ /dev/null @@ -1,16 +0,0 @@ -local skeleton = require 'common_lsp/skeleton' -require 'common_lsp/gopls' -require 'common_lsp/texlab' -require 'common_lsp/clangd' - -local M = { - util = require 'common_lsp/util'; -} - -local mt = {} -function mt:__index(k) - return skeleton[k] -end - -return setmetatable(M, mt) --- vim:et ts=2 sw=2 diff --git a/lua/nvim_lsp.lua b/lua/nvim_lsp.lua new file mode 100644 index 00000000..7868e3a4 --- /dev/null +++ b/lua/nvim_lsp.lua @@ -0,0 +1,16 @@ +local skeleton = require 'nvim_lsp/skeleton' +require 'nvim_lsp/gopls' +require 'nvim_lsp/texlab' +require 'nvim_lsp/clangd' + +local M = { + util = require 'nvim_lsp/util'; +} + +local mt = {} +function mt:__index(k) + return skeleton[k] +end + +return setmetatable(M, mt) +-- vim:et ts=2 sw=2 diff --git a/lua/common_lsp/clangd.lua b/lua/nvim_lsp/clangd.lua index 465af674..b0d4ec25 100644 --- a/lua/common_lsp/clangd.lua +++ b/lua/nvim_lsp/clangd.lua @@ -1,5 +1,5 @@ -local skeleton = require 'common_lsp/skeleton' -local util = require 'common_lsp/util' +local skeleton = require 'nvim_lsp/skeleton' +local util = require 'nvim_lsp/util' local lsp = vim.lsp local default_capabilities = lsp.protocol.make_client_capabilities() diff --git a/lua/common_lsp/gopls.lua b/lua/nvim_lsp/gopls.lua index e3061d16..86f5e7be 100644 --- a/lua/common_lsp/gopls.lua +++ b/lua/nvim_lsp/gopls.lua @@ -1,5 +1,5 @@ -local skeleton = require 'common_lsp/skeleton' -local util = require 'common_lsp/util' +local skeleton = require 'nvim_lsp/skeleton' +local util = require 'nvim_lsp/util' local lsp = vim.lsp skeleton.gopls = { diff --git a/lua/common_lsp/skeleton.lua b/lua/nvim_lsp/skeleton.lua index 574c4bb8..9fa6f835 100644 --- a/lua/common_lsp/skeleton.lua +++ b/lua/nvim_lsp/skeleton.lua @@ -1,4 +1,4 @@ -local util = require 'common_lsp/util' +local util = require 'nvim_lsp/util' local api, validate, lsp = vim.api, vim.validate, vim.lsp local tbl_extend = vim.tbl_extend @@ -76,7 +76,7 @@ function skeleton.__newindex(t, template_name, template) trigger = "BufReadPost *" end api.nvim_command(string.format( - "autocmd %s lua require'common_lsp'[%q].manager.try_add()" + "autocmd %s lua require'nvim_lsp'[%q].manager.try_add()" , trigger , config.name )) @@ -118,7 +118,7 @@ function skeleton.__newindex(t, template_name, template) M._setup_buffer(client.id) else api.nvim_command(string.format( - "autocmd BufEnter <buffer=%d> ++once lua require'common_lsp'[%q]._setup_buffer(%d)" + "autocmd BufEnter <buffer=%d> ++once lua require'nvim_lsp'[%q]._setup_buffer(%d)" , template_name , bufnr , client.id diff --git a/lua/common_lsp/texlab.lua b/lua/nvim_lsp/texlab.lua index d0339e1f..223f214a 100644 --- a/lua/common_lsp/texlab.lua +++ b/lua/nvim_lsp/texlab.lua @@ -1,5 +1,5 @@ -local skeleton = require 'common_lsp/skeleton' -local util = require 'common_lsp/util' +local skeleton = require 'nvim_lsp/skeleton' +local util = require 'nvim_lsp/util' local lsp = vim.lsp local cwd = vim.loop.cwd() diff --git a/lua/common_lsp/util.lua b/lua/nvim_lsp/util.lua index 6cc6db0f..190869e6 100644 --- a/lua/common_lsp/util.lua +++ b/lua/nvim_lsp/util.lua @@ -84,7 +84,7 @@ function M.create_module_commands(module_name, commands) table.insert(parts, command_name) -- The command definition. table.insert(parts, - string.format("lua require'common_lsp'[%q].commands[%q][1]()", module_name, command_name)) + string.format("lua require'nvim_lsp'[%q].commands[%q][1]()", module_name, command_name)) api.nvim_command(table.concat(parts, " ")) end end diff --git a/scripts/docgen.lua b/scripts/docgen.lua index 6cd2b1cb..159c7b5e 100644 --- a/scripts/docgen.lua +++ b/scripts/docgen.lua @@ -1,4 +1,4 @@ -local skeleton = require 'common_lsp/skeleton' +local skeleton = require 'nvim_lsp/skeleton' local inspect = vim.inspect local function filter(...) @@ -91,8 +91,8 @@ for k, v in pairs(skeleton) do ## {{template_name}} {{preamble}} -common_lsp.{{template_name}}.setup({config}) -common_lsp#setup("{{template_name}}", {config}) +nvim_lsp.{{template_name}}.setup({config}) +nvim_lsp#setup("{{template_name}}", {config}) ``` {{body}} |
