Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
fix(solidity/core/compiler): fixed diagnostic storage and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSwapFeeder committed Dec 10, 2023
1 parent 18772ce commit c33c91b
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use utils::{convert_severity, get_root_path, slashify_path, normalized_slash_pat
mod affected_files_store;
use affected_files_store::AffectedFilesStore;


#[derive(Debug)]
struct State {
compiler: Option<Compiler>,
Expand Down Expand Up @@ -342,13 +343,24 @@ impl Backend {
raised_diagnostics: &HashMap<String, Vec<Diagnostic>>,
) {
let mut state = self.state.lock().await;

eprintln!("Files with errors: {:?}", raised_diagnostics);
state
.affected_files
.add_project_file(project_path.clone(), filepath.clone());
let raised_files = raised_diagnostics.keys().cloned().collect::<Vec<String>>();
let without_diagnostics = state.affected_files.fill_affected_files(raised_files, &project_path);

let affected_files = state.affected_files.get_affected_files(&project_path);
drop(state);
let mut without_diagnostics = vec![];

for file in affected_files {
if !raised_diagnostics.contains_key(&file) { // if not potential not affected file is not in raised diags
raised_diagnostics.insert(file.clone(), vec![]);
without_diagnostics.push(file);
}
}

self.client
.log_message(
MessageType::INFO,
Expand Down

0 comments on commit c33c91b

Please sign in to comment.