Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TextMate missing item #8251

Merged
merged 2 commits into from
Feb 10, 2023
Merged

Conversation

ryanbrandenburg
Copy link
Contributor

Summary of the changes

  • Seen when running locally, the TextMate colorization was missing from the baseline file.

@ryanbrandenburg ryanbrandenburg requested a review from a team as a code owner February 9, 2023 18:00
@ryanbrandenburg
Copy link
Contributor Author

Copy link
Contributor

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to take your word for it :)

@ryanbrandenburg ryanbrandenburg merged commit 1d3a3a8 into dotnet:main Feb 10, 2023
@@ -96,15 +96,19 @@ public async Task VerifyGetClassificationsAsync(IEnumerable<ClassificationSpan>
var expectedArray = expectedClassifications.ToArray();
var actualOffset = 0;

for (var i = 0; i < actualArray.Length; i++)
for (var i = 0; i < expectedArray.Length; i++)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if actualClassifications << expectedClassifications, this could still throw, but I see how if actual contains "Syntactic" and expected does not, then the new code is the much more likely to succeed state.  You could also have (theoretically) a scenario where there are trailing syntactic classifications  causes the check on L131 to fail.

Would it make sense to filter actualArray into actualSemanticClassifications with the clause on L104 (Linq.Where or similar), check the lengths, and then proceed through the equal length arrays?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the Where suggestion, much cleaner. I still prefer that the length is checked at the bottom so that we proceed through the arrays before checking length (ie, finding out what area is messed up is more informative than finding out the difference in expected length).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants