-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix goto-def on partial methods in LSP #68559
Conversation
|
||
namespace Microsoft.CodeAnalysis.GoToDefinition | ||
{ | ||
internal static class GoToDefinitionHelpers | ||
{ | ||
public static async Task<ImmutableArray<DefinitionItem>> GetDefinitionsAsync( |
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.
moved to common location. not tied to 'EditorFeatures' (e.g. VS) impl of goto-def.
symbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, project.Solution, cancellationToken).ConfigureAwait(false) ?? symbol; | ||
var solution = project.Solution; | ||
symbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, solution, cancellationToken).ConfigureAwait(false) ?? symbol; | ||
symbol = await GoToDefinitionFeatureHelpers.TryGetPreferredSymbolAsync(solution, symbol, cancellationToken).ConfigureAwait(false); |
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 continues the long pain of having something like 3 different goto-def impls in roslyn, which do/don't use the same set of underlying helpers to get consistent results. This includes IGoToDefinitionService, IAsyncGoToDefinitionService, and IFindDefinitionService. Ideally we can get to a place where this all gets burned down. But it's woven so deeply into different systems that that's going to be very hard for a while.
{ | ||
internal static class GoToDefinitionFeatureHelpers | ||
{ | ||
public static async Task<ISymbol?> TryGetPreferredSymbolAsync( |
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.
pure move.
ISymbol? symbol, | ||
Solution solution, | ||
bool thirdPartyNavigationAllowed, | ||
CancellationToken cancellationToken) |
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.
pure move.
Nice, our first forcing function to validate the roslyn server insertion infra for VSCode! |
Fixes dotnet/vscode-csharp#5740