diff options
| -rw-r--r-- | CONTRIBUTING.md | 47 | ||||
| -rw-r--r-- | README.md | 54 | ||||
| -rw-r--r-- | scripts/README_template.md | 52 |
3 files changed, 84 insertions, 69 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d0ba530..9ac8e039 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,21 @@ -# Requirements +# Contributing to nvim-lspconfig + +Thank you! + +## Requirements - [Neovim](https://neovim.io/) :P -- `scripts/docgen.lua` expects a unix system. -- Lint task requires [luacheck](https://github.com/mpeterv/luacheck#installation). +- Documentation is generated by `scripts/docgen.lua`. + - Only works on unix, you can ignore it on Windows. +- Lint task requires [luacheck](https://github.com/luarocks/luacheck#installation). + +## Lint + +PRs are checked with Luacheck. To run the linter locally: -# Generating docs + make lint + +## Generating docs > Note: Github Actions automatically generates the docs, so only modify > `README_template.md` or the `docs` object on the server config. @@ -15,7 +26,7 @@ To preview the generated `README.md` locally, run `scripts/docgen.lua` from nvim -R -Es +'set rtp+=$PWD' +'luafile scripts/docgen.lua' -# Configs +## Configs The `configs` module is a singleton where configs are defined. In `vim.validate` parlance here is the "spec": @@ -66,20 +77,16 @@ Example: ## Auto-install -Configs may optionally provide `install()` and `install_info()` functions. This -will be discovered by `:LspInstall` and `:LspInstallInfo`. - -`function install()` is the signature and it is expected that it will create -any data in `util.base_install_dir/{server_name}`. - -`function install_info()` should return a table with at least `is_installed` -which indicates the current status of installation (if it is installed by us). -It can contain any other additional data that the user may find useful. +Configs may optionally provide `install()` and `install_info()` functions which +are discovered by `:LspInstall` and `:LspInstallInfo`. Function +`util.npm_installer()` can be used for`npm`-installable language servers. See +`elmls.lua`, `tsserver.lua`, `bashls.lua` for examples. -Function `util.npm_installer()` can be used for`npm`-installable language -servers. See `elmls.lua`, `tsserver.lua`, `bashls.lua` for examples. - -## Lint +Note **we are considering removing the auto-install concept** +([#334](https://github.com/neovim/nvim-lspconfig/issues/334)). Instead, each +config should _document_ key installation details: -When you create a pull request and push commit, Github Action run luacheck automaticaly. -If you want to run luacheck on your local, you can use `make lint`. +- URL to download the server +- URL to documentation explaining how to install the server +- Brief instructions that user can copy/paste into their shell to install via + common package managers such as apt-get/homebrew. @@ -1,40 +1,44 @@ -# nvim-lsp +# nvim-lspconfig Collection of common configurations for the [Nvim LSP client](https://neovim.io/doc/user/lsp.html). -**Note:** `nvim-lsp` is unrelated to [vim-lsp](https://github.com/prabirshrestha/vim-lsp). +## Best-effort, unsupported -It is hoped that these configurations serve as a "source of truth", but they -are strictly _best effort_. If something doesn't work, these configs are useful -as a starting point, which you can adjust to fit your environment. +The configurations here are strictly **best effort and unsupported**. -This is work-in-progress and **requires [Nvim HEAD/nightly](https://github.com/neovim/neovim/releases/tag/nightly)**. -Update Nvim and nvim-lsp before reporting an issue. +This repo is (1) a place for Nvim LSP users to collaboratively provide starting +examples for the many LSP backends out there, and (2) a reference for the +current best practice (or most popular) regarding choice of server, setup, etc. -## Contributions are welcome! +## Requires Nvim 0.5 HEAD -There are many language servers in the world, and not enough time. -Help us create configs for *all the LSPs!* +While Nvim LSP undergoes development, the configs in this repo assume that you +are using the latest [Nvim HEAD/nightly build](https://github.com/neovim/neovim/releases/tag/nightly). -1. Read [CONTRIBUTING.md](CONTRIBUTING.md) for instructions. +Update Nvim and nvim-lspconfig before reporting an issue. + +## Contributions + +It's up to you to send improvements so that these configs align with current +best practices for a given language. + +1. Read [CONTRIBUTING.md](CONTRIBUTING.md). Ask questions in [Neovim Gitter](https://gitter.im/neovim/neovim). 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). -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). + [emacs-lsp](https://github.com/emacs-lsp/lsp-mode#supported-languages). +3. Create a new file at `lua/nvim_lsp/SERVER_NAME.lua`. + - Copy an [existing config](https://github.com/neovim/nvim-lspconfig/blob/master/lua/nvim_lsp/) + to get started. Most configs are simple. For an extensive example see + [texlab.lua](https://github.com/neovim/nvim-lspconfig/blob/master/lua/nvim_lsp/texlab.lua). ## Install - Requires [Nvim HEAD/nightly](https://github.com/neovim/neovim/releases/tag/nightly) (v0.5 prerelease). -- nvim-lsp is just a plugin. Install it like any other Vim plugin. - - e.g. [vim-plug](https://github.com/junegunn/vim-plug) +- nvim-lspconfig is just a plugin. Install it like any other Vim plugin, e.g. with [vim-plug](https://github.com/junegunn/vim-plug): ``` - :Plug 'neovim/nvim-lsp' + :Plug 'neovim/nvim-lspconfig' ``` -- Call `:packadd nvim-lsp` in your vimrc if you installed nvim-lsp to - `'packpath'` or if you use a package manager such as minpac. +- Call `:packadd nvim-lspconfig` in your vimrc if you installed nvim-lspconfig to `'packpath'` or if you use a package manager such as minpac. ## Usage @@ -43,7 +47,7 @@ reasonable defaults and some server-specific things like commands or different diagnostics. ```lua -vim.cmd('packadd nvim-lsp') -- If installed as a Vim "package". +vim.cmd('packadd nvim-lspconfig') -- If installed as a Vim "package". require'nvim_lsp'.<config>.setup{name=…, settings = {…}, …} ``` @@ -51,7 +55,7 @@ If you want to add this to your vimrc, you will need to enclose it in a `lua` bl ```vim lua <<EOF -vim.cmd('packadd nvim-lsp') -- If installed as a Vim "package". +vim.cmd('packadd nvim-lspconfig') -- If installed as a Vim "package". require'nvim_lsp'.<config>.setup{name=…, settings = {…}, …} EOF ``` @@ -75,7 +79,7 @@ To use the defaults, just call `setup()` with an empty `config` parameter. For the `gopls` config, that would be: ```lua -vim.cmd('packadd nvim-lsp') -- If installed as a Vim "package". +vim.cmd('packadd nvim-lspconfig') -- If installed as a Vim "package". require'nvim_lsp'.gopls.setup{} ``` @@ -3035,7 +3039,7 @@ require'nvim_lsp'.omnisharp.setup{} Commands: Default Values: - cmd = { "/home/runner/.cache/nvim/nvim_lsp/omnisharp/run", "--languageserver", "--hostPID", "2630" } + cmd = { "/home/runner/.cache/nvim/nvim_lsp/omnisharp/run", "--languageserver", "--hostPID", "2702" } filetypes = { "cs", "vb" } init_options = {} on_new_config = <function 1> diff --git a/scripts/README_template.md b/scripts/README_template.md index dc0b4052..bb590cc1 100644 --- a/scripts/README_template.md +++ b/scripts/README_template.md @@ -1,40 +1,44 @@ -# nvim-lsp +# nvim-lspconfig Collection of common configurations for the [Nvim LSP client](https://neovim.io/doc/user/lsp.html). -**Note:** `nvim-lsp` is unrelated to [vim-lsp](https://github.com/prabirshrestha/vim-lsp). +## Best-effort, unsupported -It is hoped that these configurations serve as a "source of truth", but they -are strictly _best effort_. If something doesn't work, these configs are useful -as a starting point, which you can adjust to fit your environment. +The configurations here are strictly **best effort and unsupported**. -This is work-in-progress and **requires [Nvim HEAD/nightly](https://github.com/neovim/neovim/releases/tag/nightly)**. -Update Nvim and nvim-lsp before reporting an issue. +This repo is (1) a place for Nvim LSP users to collaboratively provide starting +examples for the many LSP backends out there, and (2) a reference for the +current best practice (or most popular) regarding choice of server, setup, etc. -## Contributions are welcome! +## Requires Nvim 0.5 HEAD -There are many language servers in the world, and not enough time. -Help us create configs for *all the LSPs!* +While Nvim LSP undergoes development, the configs in this repo assume that you +are using the latest [Nvim HEAD/nightly build](https://github.com/neovim/neovim/releases/tag/nightly). -1. Read [CONTRIBUTING.md](CONTRIBUTING.md) for instructions. +Update Nvim and nvim-lspconfig before reporting an issue. + +## Contributions + +It's up to you to send improvements so that these configs align with current +best practices for a given language. + +1. Read [CONTRIBUTING.md](CONTRIBUTING.md). Ask questions in [Neovim Gitter](https://gitter.im/neovim/neovim). 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). -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). + [emacs-lsp](https://github.com/emacs-lsp/lsp-mode#supported-languages). +3. Create a new file at `lua/nvim_lsp/SERVER_NAME.lua`. + - Copy an [existing config](https://github.com/neovim/nvim-lspconfig/blob/master/lua/nvim_lsp/) + to get started. Most configs are simple. For an extensive example see + [texlab.lua](https://github.com/neovim/nvim-lspconfig/blob/master/lua/nvim_lsp/texlab.lua). ## Install - Requires [Nvim HEAD/nightly](https://github.com/neovim/neovim/releases/tag/nightly) (v0.5 prerelease). -- nvim-lsp is just a plugin. Install it like any other Vim plugin. - - e.g. [vim-plug](https://github.com/junegunn/vim-plug) +- nvim-lspconfig is just a plugin. Install it like any other Vim plugin, e.g. with [vim-plug](https://github.com/junegunn/vim-plug): ``` - :Plug 'neovim/nvim-lsp' + :Plug 'neovim/nvim-lspconfig' ``` -- Call `:packadd nvim-lsp` in your vimrc if you installed nvim-lsp to - `'packpath'` or if you use a package manager such as minpac. +- Call `:packadd nvim-lspconfig` in your vimrc if you installed nvim-lspconfig to `'packpath'` or if you use a package manager such as minpac. ## Usage @@ -43,7 +47,7 @@ reasonable defaults and some server-specific things like commands or different diagnostics. ```lua -vim.cmd('packadd nvim-lsp') -- If installed as a Vim "package". +vim.cmd('packadd nvim-lspconfig') -- If installed as a Vim "package". require'nvim_lsp'.<config>.setup{name=…, settings = {…}, …} ``` @@ -51,7 +55,7 @@ If you want to add this to your vimrc, you will need to enclose it in a `lua` bl ```vim lua <<EOF -vim.cmd('packadd nvim-lsp') -- If installed as a Vim "package". +vim.cmd('packadd nvim-lspconfig') -- If installed as a Vim "package". require'nvim_lsp'.<config>.setup{name=…, settings = {…}, …} EOF ``` @@ -75,7 +79,7 @@ To use the defaults, just call `setup()` with an empty `config` parameter. For the `gopls` config, that would be: ```lua -vim.cmd('packadd nvim-lsp') -- If installed as a Vim "package". +vim.cmd('packadd nvim-lspconfig') -- If installed as a Vim "package". require'nvim_lsp'.gopls.setup{} ``` |
