@@ -87,28 +87,24 @@ this to your [coc.nvim configuration file][vim_coc_nvim_config_file]:
8787This requires [ ` nvim-lspconfig ` ] ( https://github.com/neovim/nvim-lspconfig ) .
8888``` lua
8989lua << EOF
90- local lspconfig = require ' lspconfig'
9190-- Only define once
92- if not lspconfig .hdl_checker then
93- require ' lspconfig/ configs' .hdl_checker = {
91+ if not require ' lspconfig.configs ' .hdl_checker then
92+ require ' lspconfig. configs' .hdl_checker = {
9493 default_config = {
9594 cmd = {" hdl_checker" , " --lsp" , };
9695 filetypes = {" vhdl" , " verilog" , " systemverilog" };
9796 root_dir = function (fname )
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 )
97+ -- will look for the .hdl_checker.config file in parent directory, a
98+ -- .git directory, or else use the current directory, in that order.
99+ local util = require ' lspconfig' .util
100+ return util .root_pattern (' .hdl_checker.config' )(fname ) or util .find_git_ancestor (fname ) or util .path .dirname (fname )
105101 end ;
106102 settings = {};
107103 };
108104 }
109105end
110106
111- lspconfig .hdl_checker .setup ()
107+ require ' lspconfig' .hdl_checker .setup {}
112108
113109EOF
114110```
0 commit comments