Skip to content

Commit

Permalink
Get start point for applicable fixmes
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Feb 9, 2024
1 parent 4080540 commit 7fae629
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/analyzer/classlike_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl<'a> ClassLikeAnalyzer<'a> {
&statements_analyzer.comments,
&statements_analyzer.get_config().all_custom_issues,
None,
classlike_storage.meta_start.start_offset,
None,
);

Expand Down
2 changes: 2 additions & 0 deletions src/analyzer/expression_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ pub(crate) fn analyze(
}
}

analysis_data.applicable_fixme_start = expr.pos().end_offset() as u32;

Ok(())
}

Expand Down
1 change: 1 addition & 0 deletions src/analyzer/file_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl<'a> FileAnalyzer<'a> {
&Vec::from_iter(self.file_source.comments.iter()),
&self.get_config().all_custom_issues,
None,
0,
None,
);

Expand Down
3 changes: 3 additions & 0 deletions src/analyzer/function_analysis_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub struct FunctionAnalysisData {
pub replacements: BTreeMap<(u32, u32), Replacement>,
pub insertions: BTreeMap<u32, Vec<String>>,
pub current_stmt_offset: Option<StmtStart>,
pub applicable_fixme_start: u32,
pub expr_fixme_positions: FxHashMap<(u32, u32), StmtStart>,
pub symbol_references: SymbolReferences,
pub issue_filter: Option<FxHashSet<IssueKind>>,
Expand All @@ -52,6 +53,7 @@ impl FunctionAnalysisData {
comments: &Vec<&(Pos, Comment)>,
all_custom_issues: &FxHashSet<String>,
current_stmt_offset: Option<StmtStart>,
applicable_fixme_start: u32,
hakana_fixme_or_ignores: Option<
BTreeMap<u32, Vec<(IssueKind, (u32, u32, u32, u32, bool))>>,
>,
Expand All @@ -72,6 +74,7 @@ impl FunctionAnalysisData {
replacements: BTreeMap::new(),
insertions: BTreeMap::new(),
current_stmt_offset,
applicable_fixme_start,
hh_fixmes: file_source.hh_fixmes.clone(),
symbol_references: SymbolReferences::new(),
issue_filter: None,
Expand Down
1 change: 1 addition & 0 deletions src/analyzer/functionlike_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ impl<'a> FunctionLikeAnalyzer<'a> {
} else {
None
},
functionlike_storage.meta_start.start_offset,
parent_analysis_data
.as_ref()
.map(|parent_analysis_data| parent_analysis_data.hakana_fixme_or_ignores.clone()),
Expand Down
2 changes: 2 additions & 0 deletions src/analyzer/stmt_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ pub(crate) fn analyze(
);
}

analysis_data.applicable_fixme_start = stmt.0.end_offset() as u32;

Ok(())
}

Expand Down

0 comments on commit 7fae629

Please sign in to comment.