From 81d1c52ffab3f9ccb502ee85d9b5b8c3b72ca8c0 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Mon, 23 Oct 2023 22:14:53 -0400 Subject: [PATCH] Allow multiple insertions at the same location --- src/analyzer/functionlike_analyzer.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/analyzer/functionlike_analyzer.rs b/src/analyzer/functionlike_analyzer.rs index e2b71655..63b912a8 100644 --- a/src/analyzer/functionlike_analyzer.rs +++ b/src/analyzer/functionlike_analyzer.rs @@ -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;