Skip to content

Commit 3d4613f

Browse files
authored
Merge pull request #279 from SethGower/master
Adds more info for configuring Neovim's LSP client for VHDL_LS
2 parents cae4e21 + 70cc4bf commit 3d4613f

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,26 @@ following snippet to your config:
5858
(vhdl-ext-lsp-set-server 've-rust-hdl) ; `lsp' config
5959
```
6060

61-
## Manual Installation for Neovim
61+
## Installation for Neovim
6262

63+
### Automatic Installation
64+
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.
65+
66+
### Automatic Configuration using `nvim-lspconfig`
67+
68+
[`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)
69+
70+
In order to configure it, simply add
71+
72+
```lua
73+
lspconfig = require('lspconfig')
74+
lspconfig['vhdl_ls'].setup({
75+
on_attach = on_attach,
76+
capabilities = capabilities
77+
})
78+
```
79+
80+
### Manual Configuration using Neovim's built in client
6381
Neovim provides an LSP client to the VHDL_LS language server. Download the
6482
VHDL_LS release. The binary must be on the path and executable (if you can run
6583
"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
8098
server. There are also other options, like automatically starting it when
8199
opening a certain file type, see the [Neovim LSP documentation](https://neovim.io/doc/user/lsp.html) for more.
82100

83-
### Configuration
101+
## Configuration
84102
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`.
85103

86104
`vhdl_ls` will load configuration files in the following order of priority (first to last):

0 commit comments

Comments
 (0)