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 speed up ctrl-click #73442

Merged
merged 4 commits into from
May 13, 2024

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 13, 2024 04:36
@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 13, 2024
@@ -72,7 +73,8 @@ public async Task<(int? targetPosition, TextSpan tokenSpan)> GetTargetIfControlF
if (token == default)
return default;

var semanticModel = await document.GetRequiredSemanticModelAsync(cancellationToken).ConfigureAwait(false);
// We don't need nullable information to compute control flow targets. So avoid expensive work computing this.
var semanticModel = await document.GetRequiredNullableDisabledSemanticModelAsync(cancellationToken).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

debugged through, and there are no other codepaths where we retrieve semantic models for this feature.

// don't want to wait on expensive operations like computing source-generators or skeletons if we can avoid
// it. So first try with a frozen document, then fallback to a normal document. This mirrors how go-to-def
// works as well.
return await GetDefinitionLocationWorkerAsync(document.WithFrozenPartialSemantics(cancellationToken)).ConfigureAwait(false) ??
Copy link
Member Author

Choose a reason for hiding this comment

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

this is what we did in #72714. however, we still have not fully unified all the codepaths involved in navigating to a symbol :'( so there's still the need to update in a one-off manner like this. ideally this can be unified in the future.

@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal

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:

@CyrusNajmabadi CyrusNajmabadi merged commit b6ab47d into dotnet:main May 13, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the speedupCtrlClick branch May 13, 2024 16:33
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 13, 2024
@Cosifne Cosifne modified the milestones: Next, 17.11 P2 May 28, 2024
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