From fd02aaedcc64eb3777b449efac7ecd12c3c13d0b Mon Sep 17 00:00:00 2001 From: Seth Gower Date: Thu, 21 Mar 2024 07:55:35 -0400 Subject: [PATCH 1/2] Updates README.md to add better neovim installation instructions --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d7e345b..e1907817 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,26 @@ following snippet to your config: (vhdl-ext-lsp-set-server 've-rust-hdl) ; `lsp' config ``` -## Manual Installation for Neovim +## Installation for Neovim +### Automatic Installation +You can install `rust_hdl` automatically in Neovim using [`:Mason`](https://github.com/williamboman/mason.nvim), in Mason the package is called `rust_hdl`. If you don't have `:Mason`, you can simply install the binary as previously described. + +### Automatic Configuration using `nvim-lspconfig` + +[`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig) has a built in configuration for [`vhdl_ls`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vhdl_ls) + +In order to configure it, simply add + +```lua +lspconfig = require('lspconfig') +lspconfig['vhdl_ls'].setup({ + on_attach = on_attach, + capabilities = capabilities +}) +``` + +### Manual Configuration Neovim provides an LSP client to the VHDL_LS language server. Download the VHDL_LS release. The binary must be on the path and executable (if you can run "vhdl_ls -h" in the terminal then you're good). @@ -80,7 +98,7 @@ Using the example above, pressing F5 while inside Neovim starts the language server. There are also other options, like automatically starting it when opening a certain file type, see the [Neovim LSP documentation](https://neovim.io/doc/user/lsp.html) for more. -### Configuration +## Configuration The language server needs to know your library mapping to perform full analysis of the code. For this it uses a configuration file in the [TOML](https://github.com/toml-lang/toml) format named `vhdl_ls.toml`. `vhdl_ls` will load configuration files in the following order of priority (first to last): From 70cc4bf68cea6b3b2f183e6e5992a337b0e1e26a Mon Sep 17 00:00:00 2001 From: Seth Gower Date: Thu, 21 Mar 2024 07:58:15 -0400 Subject: [PATCH 2/2] rewords section title slightly for nvim --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1907817..acb349cb 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ lspconfig['vhdl_ls'].setup({ }) ``` -### Manual Configuration +### Manual Configuration using Neovim's built in client Neovim provides an LSP client to the VHDL_LS language server. Download the VHDL_LS release. The binary must be on the path and executable (if you can run "vhdl_ls -h" in the terminal then you're good).