-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Support local functions in outline/breadcrumbs #78605
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
Conversation
src/Features/CSharp/Portable/NavigationBar/CSharpNavigationBarItemService.cs
Outdated
Show resolved
Hide resolved
foreach (var localFunction in node.DescendantNodes().Where(CSharpSyntaxFacts.Instance.IsLocalFunctionStatement)) | ||
{ | ||
var localFunctionSymbol = semanticModel.GetDeclaredSymbol(localFunction, cancellationToken); | ||
// Check to make sure we only include local functions that are directly contained in the current member. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels n^2 how you have things now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it possibly was. I adjusted the implementation and should only check each local function once
Can you add tests inside a prop accessor. I want to make sure we don't hit the local function multiple times. |
good test case, added. |
Resolves dotnet/vscode-csharp#6767
I am open to other ideas on how to render the top level entry point. For now I just used the display name, which should match what other places like diagnostics may report. Potentially could not include it at all, or name it something else?
In VSCode:

In VS, we only show max 2 levels, so the only change is that the top level program entry point can be seen, instead of it being blank:
