Repository navigation
Find a resource name that comes before a longer one on the same line - #52
Open
xperiandri wants to merge 1 commit into
Open
xperiandri wants to merge 1 commit into
xperiandri wants to merge 1 commit into
Conversation
`GetAllIndexesAsync` took the longest of the names that occur anywhere in the rest of a line and carried on after its first occurrence. A shorter name that stood before a longer one on the same line was skipped, so its text was not shown. In `Strings.A + Resources.B` only `Resources.B` was found. `IndexOfAnyAsync` now returns the earliest occurrence of any of the names, which is what its name says, so every name on a line is found, from left to right. A line that uses one name, or the longer names first, gives the same indexes as before. Added tests for both methods. Four of them fail without the change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
Fixes #61.
When a line uses more than one resource file, the text of a name is not shown if a longer name is used later on the same line. For example, in
Strings.A + Resources.BonlyResources.Bgets its text, and inStrings.A, Resources.B, Strings.Cthe firstStrings.Ais missed.IndexOfAnyAsyncnow returns the earliest occurrence of any of the names, as its name says, so every name on a line is found, from left to right. Tests for it are added, and four of them fail without the change.Cause, changes and verification
Cause
GetAllIndexesAsyncasksIndexOfAnyAsyncfor the next match and carries on after it.IndexOfAnyAsyncreturned the first occurrence of the longest name that occurs anywhere in the rest of the line, so a shorter name that stands earlier was skipped.Changes
IndexOfAnyAsyncreturns the earliest occurrence of any of the names. A line that uses one name, or the longer names first, gives the same result as before.ResourceAdornmentManageralready goes through the indexes from right to left, which expects them in ascending order.IndexOfAnyAsyncandGetAllIndexesAsyncare added to the test project, and four of them fail without the change. They also pin down what already worked: a name used twice, a name that ends with another one (MyResources.andResources.), no match and no names.Verification
🤖 Generated with Claude Code