The configuration in the readme for the native nvim LSP client doesn't seem to be correct. It should be lspconfig, not nvim_lsp (this requires the lspconfig plugin to be installed, but this is the normal requirement). I also feel like the current directory is a better fall back when a proper root can't be found as opposed to using the home dir. Using home dir leads to exceedingly long load times.
I personally use .hdl_checker.config as root, and if it can't find, it uses current dir. This is simply because at work I deal with projects that are comprised of multiple repos, but need to see files across repos, so I have the .hdl_checker.config in the parent dir to the repos.
I recommend something like this
local nvim_lsp = require'lspconfig'
if not nvim_lsp.hdl_checker then
require'lspconfig/configs'.hdl_checker = {
default_config = {
cmd = {"hdl_checker", "--lsp", };
filetypes = {"vhdl", "verilog", "systemverilog"};
root_dir = function(fname)
return nvim_lsp.util.find_git_ancestor(fname) or util.path.dirname(fname)
end;
settings = {};
};
}
end
This is my config, from my init.lua in my dotfiles
local lspconfig = require('lspconfig')
local configs = require('lspconfig/configs')
local util = require('lspconfig/util')
if not lspconfig.hdl_checker then
configs.hdl_checker = {
default_config = {
autostart = false, -- disabled auto start since I am giving rust_hdl a shot
cmd = {"hdl_checker", "--lsp"};
filetypes = { "vhdl" };
root_dir = function(fname)
return util.root_pattern('.hdl_checker.config')(fname) or util.path.dirname(fname)
end;
settings = {};
};
}
end
(none of the system stuff is really necessary, except for maybe my nvim version)
Issue details
The configuration in the readme for the native
nvim
LSP client doesn't seem to be correct. It should belspconfig
, notnvim_lsp
(this requires thelspconfig
plugin to be installed, but this is the normal requirement). I also feel like the current directory is a better fall back when a proper root can't be found as opposed to using the home dir. Using home dir leads to exceedingly long load times.I personally use
.hdl_checker.config
as root, and if it can't find, it uses current dir. This is simply because at work I deal with projects that are comprised of multiple repos, but need to see files across repos, so I have the.hdl_checker.config
in the parent dir to the repos.I recommend something like this
This is my config, from my
init.lua
in my dotfiles(none of the system stuff is really necessary, except for maybe my
nvim
version)nvim -v
Features: +acl +iconv +tui See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info