Skip to content

Commit ca8a3ae

Browse files
authored
Merge pull request #344 from Schottkyc137/339-custom-vhdl-libraries-location
Add option for the libraries location as part of the vhdl_lang executable
2 parents 3b04fe5 + b7dc42f commit ca8a3ae

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

vhdl_ls/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ struct Args {
1414
#[arg(long, default_value_t = false)]
1515
no_lint: bool,
1616

17+
/// Path to the config file for the VHDL standard libraries (i.e., IEEE std_logic_1164).
18+
/// If omitted, will search for these libraries in a set of standard paths
19+
#[arg(short = 'l', long)]
20+
libraries: Option<String>,
21+
1722
/// Normally warning and error messages are sent to window/showMessage
1823
/// This will silence all window/showMessage and only use window/logMessage
1924
#[arg(long, default_value_t = false)]
@@ -28,6 +33,7 @@ fn main() {
2833
vhdl_ls::start(VHDLServerSettings {
2934
no_lint: args.no_lint,
3035
silent: args.silent,
36+
libraries_path: args.libraries,
3137
..Default::default()
3238
});
3339
}

vhdl_ls/src/vhdl_server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub struct VHDLServerSettings {
5353
pub no_lint: bool,
5454
pub silent: bool,
5555
pub non_project_file_handling: NonProjectFileHandling,
56+
pub libraries_path: Option<String>,
5657
}
5758

5859
pub struct VHDLServer {
@@ -123,7 +124,10 @@ impl VHDLServer {
123124
let mut config = Config::default();
124125

125126
if self.use_external_config {
126-
config.load_external_config(&mut self.message_filter(), None);
127+
config.load_external_config(
128+
&mut self.message_filter(),
129+
self.settings.libraries_path.clone(),
130+
);
127131
}
128132

129133
match self.load_root_uri_config() {

0 commit comments

Comments
 (0)