From 491feed8249ed9e6beeb08f3ae9b9a993ea3ca0d Mon Sep 17 00:00:00 2001 From: fmaggi <61335294+fmaggi@users.noreply.github.com> Date: Wed, 15 Mar 2023 08:29:39 -0300 Subject: feat: add vhdl support (#2504) * feat: add vhdl support * fix(vhdl_ls): added windows support --- lua/lspconfig/server_configurations/vhdl_ls.lua | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lua/lspconfig/server_configurations/vhdl_ls.lua (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/vhdl_ls.lua b/lua/lspconfig/server_configurations/vhdl_ls.lua new file mode 100644 index 00000000..7d04ec5f --- /dev/null +++ b/lua/lspconfig/server_configurations/vhdl_ls.lua @@ -0,0 +1,50 @@ +local util = require 'lspconfig.util' + +local root_files = { + 'vhdl_ls.toml', + '.vhdl_ls.toml', +} + +local cmd = { 'vhdl_ls' } +if vim.fn.has 'win32' == 1 then + cmd = { 'cmd.exe', '/C', 'vhdl_ls' } +end + +return { + default_config = { + cmd = cmd, + filetypes = { 'vhd' }, + root_dir = util.root_pattern(unpack(root_files)), + single_file_support = true, + }, + docs = { + description = [[ +Install vhdl_ls from https://github.com/VHDL-LS/rust_hdl and add it to path + +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 format named vhdl_ls.toml. + +vhdl_ls will load configuration files in the following order of priority (first to last): + + A file named .vhdl_ls.toml in the user home folder. + A file name from the VHDL_LS_CONFIG environment variable. + A file named vhdl_ls.toml in the workspace root. + +Settings in a later files overwrites those from previously loaded files. + +Example vhdl_ls.toml +``` +# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file +[libraries] +lib2.files = [ + 'pkg2.vhd', +] +lib1.files = [ + 'pkg1.vhd', + 'tb_ent.vhd' +] +``` +]], + }, +} -- cgit v1.2.3-70-g09d2