Support local functions in outline/breadcrumbs#78605
Merged
dibarbet merged 3 commits intodotnet:mainfrom May 19, 2025
Merged
Conversation
CyrusNajmabadi
suggested changes
May 16, 2025
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. |
Contributor
There was a problem hiding this comment.
This feels n^2 how you have things now
Member
Author
There was a problem hiding this comment.
I think it possibly was. I adjusted the implementation and should only check each local function once
Contributor
|
Can you add tests inside a prop accessor. I want to make sure we don't hit the local function multiple times. |
Member
Author
good test case, added. |
CyrusNajmabadi
approved these changes
May 17, 2025
src/Features/CSharp/Portable/NavigationBar/CSharpNavigationBarItemService.cs
Outdated
Show resolved
Hide resolved
This was referenced May 25, 2025
14 tasks
Copilot AI
added a commit
that referenced
this pull request
Oct 20, 2025
Updated all WorkItem attributes in the BaseType tests to point to the correct issue #41733 instead of #78605. Co-authored-by: CyrusNajmabadi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
