Skip to content

Commit 96c1dcf

Browse files
committed
Disable unused declaration detection in vhdl_lang main for now
1 parent 810af61 commit 96c1dcf

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

vhdl_lang/src/project.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct Project {
2020
root: DesignRoot,
2121
files: FnvHashMap<PathBuf, SourceFile>,
2222
empty_libraries: FnvHashSet<Symbol>,
23-
lint: UnusedDeclarationsLinter,
23+
lint: Option<UnusedDeclarationsLinter>,
2424
}
2525

2626
impl Project {
@@ -31,11 +31,15 @@ impl Project {
3131
files: FnvHashMap::default(),
3232
empty_libraries: FnvHashSet::default(),
3333
parser,
34-
lint: Default::default(),
34+
lint: None,
3535
config: Config::default(),
3636
}
3737
}
3838

39+
pub fn enable_unused_declaration_detection(&mut self) {
40+
self.lint = Some(UnusedDeclarationsLinter::default());
41+
}
42+
3943
/// Create instance from given configuration.
4044
/// Files referred by configuration are parsed into corresponding libraries.
4145
pub fn from_config(config: Config, messages: &mut dyn MessageHandler) -> Project {
@@ -228,8 +232,10 @@ impl Project {
228232
}
229233

230234
let analyzed_units = self.root.analyze(&mut diagnostics);
231-
self.lint
232-
.lint(&self.root, &self.config, &analyzed_units, &mut diagnostics);
235+
236+
if let Some(ref mut lint) = self.lint {
237+
lint.lint(&self.root, &self.config, &analyzed_units, &mut diagnostics);
238+
}
233239

234240
diagnostics
235241
}

vhdl_ls/src/vhdl_server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ impl VHDLServer {
111111
self.config_file = self.root_uri_config_file(&init_params);
112112
let config = self.load_config();
113113
self.project = Project::from_config(config, &mut self.message_filter());
114+
self.project.enable_unused_declaration_detection();
114115
self.init_params = Some(init_params);
115116
let trigger_chars: Vec<String> = r".".chars().map(|ch| ch.to_string()).collect();
116117

0 commit comments

Comments
 (0)