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

Small tweaks to the recursion walk we do when looking for strign indentation regions #73719

Merged
merged 2 commits into from
May 26, 2024

Conversation

CyrusNajmabadi
Copy link
Member

Tiny thing i noticed while looking at traces:

image

Will also be helped by #73650

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 26, 2024 05:58
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 26, 2024
@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal.


using var _ = ArrayBuilder<SyntaxNode>.GetInstance(out var nodeStack);
nodeStack.Add(root);

while (nodeStack.TryPop(out var node))
{
// DoNot' bother recursing into nodes that don't hit the requested span, they can never contribute
// regions of interest.
if (!node.Span.IntersectsWith(textSpan))
Copy link
Contributor

Choose a reason for hiding this comment

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

if (!node.Span.IntersectsWith(textSpan))

seems like we did this inefficiently in a lot of places.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup! Tackling the ones that show up in traces first

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants