From 48e24bfb55d61c64fcb30e14013b4b5ffad78a7f Mon Sep 17 00:00:00 2001 From: christoph bothe Date: Sun, 3 Mar 2024 12:07:31 +0100 Subject: [PATCH 1/2] added "Use in Neovim" to readme --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 299cba67c..46142967d 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,29 @@ following snippet to your config: (vhdl-ext-lsp-set-server 've-rust-hdl) ; `lsp' config ``` +## Use in Neovim + +Neovim provides an LSP client to the VHDL_LS language server. Install the VHDL_LS +binary e.g. via Cargo. The binary must be on the path and executable (if you +can run "vhdl_ls -h" in the terminal then you're good). Put the "vhdl_libraries" +directory into the parent directory of the VHDL_LS binary. + +In your Neovim config.lua add the following: + +```lua +function STARTVHDLLS() + vim.lsp.start({ + name = 'vhdl_ls', + cmd = {'vhdl_ls'}, + }) +end +vim.api.nvim_set_keymap('n', '', ':lua STARTVHDLLS()', { noremap = true, silent = true }) +``` + +This is just one example, there are many ways to run the language server. Anyway +when you are inside a buffer you can now hit F5 to start VHDL_LS. For more info +and options, have a look at the [Neovim LSP documentation](https://neovim.io/doc/user/lsp.html). + ### 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`. From e144c4341a7ce794af156c571f4502d9fe0b2e5f Mon Sep 17 00:00:00 2001 From: christoph bothe Date: Sun, 3 Mar 2024 17:03:26 +0100 Subject: [PATCH 2/2] added requested changes from PR discussion --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 46142967d..2bb6b07af 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,11 @@ following snippet to your config: (vhdl-ext-lsp-set-server 've-rust-hdl) ; `lsp' config ``` -## Use in Neovim +## Manual Installation for Neovim -Neovim provides an LSP client to the VHDL_LS language server. Install the VHDL_LS -binary e.g. via Cargo. The binary must be on the path and executable (if you -can run "vhdl_ls -h" in the terminal then you're good). Put the "vhdl_libraries" -directory into the parent directory of the VHDL_LS binary. +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). In your Neovim config.lua add the following: @@ -71,9 +70,9 @@ end vim.api.nvim_set_keymap('n', '', ':lua STARTVHDLLS()', { noremap = true, silent = true }) ``` -This is just one example, there are many ways to run the language server. Anyway -when you are inside a buffer you can now hit F5 to start VHDL_LS. For more info -and options, have a look at the [Neovim LSP documentation](https://neovim.io/doc/user/lsp.html). +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 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`.