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

Support 'view call hierarchy' on primary consstructor #77328

Merged
merged 9 commits into from
Feb 25, 2025

Conversation

CyrusNajmabadi
Copy link
Member

Fixes #77327

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 24, 2025 18:41
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 24, 2025
var semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
var symbolUnderCaret = await SymbolFinder.FindSymbolAtPositionAsync(
semanticModel, caretPosition, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false);
var symbolAndProject = await FindUsagesHelpers.GetRelevantSymbolAndProjectAtPositionAsync(
Copy link
Member Author

Choose a reason for hiding this comment

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

switched to common helper that gets the symbol and does hte mapping.


var point = args.TextView.Caret.Position.Point.GetPoint(args.SubjectBuffer, PositionAffinity.Predecessor);
if (point is null)
return 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.

pulled this up as we want to do this before kicking off the async work.

return;
}

var caretPosition = args.TextView.Caret.Position.BufferPosition.Position;
Copy link
Member Author

Choose a reason for hiding this comment

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

note: this was broken. we need to map the caret pos down to the subject buffer (which i now do above). otherwise projection scenarios do not work.

@CyrusNajmabadi
Copy link
Member Author

@akhera99 @JoeRobich ptal.

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 VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to view Call Hierarchy on Primary Constructors in C#
2 participants