do not check whether rule application is memoized if it is only interesting to see whether the line is obsolete#136
Merged
georghinkel merged 2 commits intomainfrom Mar 23, 2026
Merged
Conversation
…esting to see whether the line is obsolete
…ull rule application
⚡ Risk Assessment —
|
| Files | Summary |
|---|---|
ChangeTracker OptimizationAnyText/AnyText.Core/ChangeTracker.cs |
Uses Essential() method to skip memoization checks when determining if lines are obsolete, improving performance of list migration calculations. |
Matcher Obsolescence LogicAnyText/AnyText.Core/Matcher.cs |
Refactored IsObsoleted to check position-based conditions first; added overload accepting fromPosition parameter; removed redundant column existence checks. |
Rule Application Core ChangesAnyText/AnyText.Core/Rules/RuleApplication.cs, Rule.cs |
Added Essential() method to get inner rule application and new IterateLiterals overloads supporting position-based iteration. |
Rule Type ImplementationsAnyText/AnyText.Core/Rules/ChoiceRule.cs, QuoteRule.cs, SequenceRule.cs, SingleRuleApplication.cs, MultiRuleApplication.cs, LiteralRuleApplication.cs, FailedRuleApplication.cs, FailedChoiceRuleApplication.cs, InheritedFailRuleApplication.cs, RecoveredSequenceRuleApplication.cs |
Implemented GetEssentialInnerRuleApplication and new IterateLiterals overloads with ParsePosition parameter across all rule application types. |
Test CleanupAnyText/Tests/AnyText.Tests/Languages/ListExpressionTests.cs |
Minor test assertion cleanup and removal of unnecessary type casts. |
Sequence Diagram
sequenceDiagram
participant C as ChangeTracker
participant M as Matcher
participant RA as RuleApplication
participant R as Rule
participant L as LiteralRuleApplication
C->>RA: call Essential()
RA->>R: GetEssentialInnerRuleApplication()
R-->>RA: return essential inner
C->>M: IsObsoleted(essentialApp, edit)
alt position within edit range
M-->>C: return true (obsoleted)
else position after edit
M->>L: IterateLiterals(fromPosition)
L-->>M: check literal obsolescence
M-->>C: return memoization result
end
Dig Deeper With Commands
/review <file-path> <function-optional>/chat <file-path> "<question>"/roast <file-path>
Runs only when explicitly triggered.
Actionable Comments Posted: 3🧾 Coverage Summary✔️ Covered (16 files) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by MergeMonkey