Skip to content

Conversation

ToddGrun
Copy link
Contributor

This method previoulsy realized/walked the whole tree to try to find annotations to search for in it's AnnotationTable. Instead, use the GetAnnotatedNodesAndTokens to limit the search to only those areas of the tree that contain annotations.

This showed up in a profile I took of a lightbulb session which showed the preview window.

…ForConflicts

This method previoulsy realized/walked the whole tree to try to find annotations to search for in it's AnnotationTable. Instead, use the GetAnnotatedNodesAndTokens to limit the search to only those areas of the tree that contain annotations.

This showed up in a profile I took of a lightbulb session which showed the preview window.
@ToddGrun ToddGrun requested a review from a team as a code owner June 21, 2024 14:42
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 21, 2024
foreach (var lambda in lambdas)
{
foreach (var lambda in lambdas)
if (_conflictLocations.Any(cf => cf.Contains(lambda.Span)))
Copy link
Member

Choose a reason for hiding this comment

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

no 'any' that takes an arg?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't one available, and the only current extension methods we have on ImmutableHashSet are in the compiler, and I didn't want to change that in this PR.


var isInConflictLambdaBody = false;
var lambdas = node.GetAncestorsOrThis(n => n is SimpleLambdaExpressionSyntax or ParenthesizedLambdaExpressionSyntax);
if (lambdas.Count() != 0)
Copy link
Member

Choose a reason for hiding this comment

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

YIKES

private IEnumerable<(SyntaxNodeOrToken syntax, RenameActionAnnotation annotation)> GetNodesOrTokensToCheckForConflicts(
SyntaxNode syntaxRoot)
{
return syntaxRoot.DescendantNodesAndTokens(descendIntoTrivia: true)
Copy link
Member

Choose a reason for hiding this comment

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

YIKES

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