Skip to content

Commit

Permalink
Allow multiple insertions at the same location
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Oct 24, 2023
1 parent b9eb8c0 commit 81d1c52
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/analyzer/functionlike_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1407,11 +1407,17 @@ pub(crate) fn update_analysis_result_with_tast(
}

if !analysis_data.insertions.is_empty() {
analysis_result
let file_insertions = analysis_result
.insertions
.entry(*file_path)
.or_insert_with(BTreeMap::new)
.extend(analysis_data.insertions);
.or_insert_with(BTreeMap::new);

for (offset, insertions) in analysis_data.insertions {
file_insertions
.entry(offset)
.or_insert_with(Vec::new)
.extend(insertions);
}
}

let mut issues_to_emit = analysis_data.issues_to_emit;
Expand Down

0 comments on commit 81d1c52

Please sign in to comment.