Skip to content

Commit 7ecdfc8

Browse files
authored
updates nvim-lsp section of readme (#94)
1 parent 94d92af commit 7ecdfc8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,32 @@ this to your [coc.nvim configuration file][vim_coc_nvim_config_file]:
8484
```
8585
#### Using NeoVim's native language server
8686

87-
```vim
87+
This requires [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig).
88+
```lua
8889
lua << EOF
89-
local nvim_lsp = require'nvim_lsp'
90+
local lspconfig = require'lspconfig'
9091
-- Only define once
91-
if not nvim_lsp.hdl_checker then
92-
require'nvim_lsp/configs'.hdl_checker = {
92+
if not lspconfig.hdl_checker then
93+
require'lspconfig/configs'.hdl_checker = {
9394
default_config = {
9495
cmd = {"hdl_checker", "--lsp", };
9596
filetypes = {"vhdl", "verilog", "systemverilog"};
9697
root_dir = function(fname)
97-
return nvim_lsp.util.find_git_ancestor(fname) or vim.loop.os_homedir()
98+
-- will look for a parent directory with a .git directory. If none, just
99+
-- use the current directory
100+
return lspconfig.util.find_git_ancestor(fname) or lspconfig.util.path.dirname(fname)
101+
-- or (not both)
102+
-- Will look for the .hdl_checker.config file in a parent directory. If
103+
-- none, will use the current directory
104+
return lspconfig.util.root_pattern('.hdl_checker.config')(fname) or lspconfig.util.path.dirname(fname)
98105
end;
99106
settings = {};
100107
};
101108
}
102109
end
110+
111+
lspconfig.hdl_checker.setup()
112+
103113
EOF
104114
```
105115

0 commit comments

Comments
 (0)