Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,19 @@ internal static class PredefinedCommandHandlerNames
/// Command handler name for showing the Callstack Explorer tool window.
/// </summary>
public const string ShowCallstackExplorer = "Show Callstack Explorer";

/// <summary>
/// Command handler name for LSP Go To Definition.
/// </summary>
public const string LspGoToDefinition = "LSP GoToDefinitionCommandHandler";

/// <summary>
/// Command handler name for LSP Find References.
/// </summary>
public const string LspFindReferences = "LSP FindReferenceCommandHandler";

/// <summary>
/// Command handler name for LSP Go To Implementation.
/// </summary>
public const string LspGoToImplementation = "LSP GoToImplementationCommandHandler";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Microsoft.CodeAnalysis.FindReferences;
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.FindReferences)]
[Order(Before = PredefinedCommandHandlerNames.LspFindReferences)]
[method: ImportingConstructor]
[method: SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")]
internal sealed class FindReferencesCommandHandler(FindReferencesNavigationService navigationService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Microsoft.CodeAnalysis.GoToImplementation;
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.GoToImplementation)]
[Order(Before = PredefinedCommandHandlerNames.LspGoToImplementation)]
[method: ImportingConstructor]
[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
internal sealed class GoToImplementationCommandHandler(GoToImplementationNavigationService navigationService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace Microsoft.CodeAnalysis.GoToDefinition;
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.GoToDefinition)]
[Order(Before = PredefinedCommandHandlerNames.LspGoToDefinition)]
[method: ImportingConstructor]
[method: SuppressMessage("RoslynDiagnosticsReliability", "RS0033:Importing constructor should be [Obsolete]", Justification = "Used in test code: https://github.com/dotnet/roslyn/issues/42814")]
internal sealed class GoToDefinitionCommandHandler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ public override ServerCapabilities GetCapabilities(ClientCapabilities clientCapa

serverCapabilities.SpellCheckingProvider = true;

// Enable go to definition, find all references, and go to implementation capabilities for experimentation.
// These are enabled regardless of the LSP feature flag to allow clients to call these handlers.
serverCapabilities.DefinitionProvider = true;
serverCapabilities.ReferencesProvider = new ReferenceOptions
{
WorkDoneProgress = true,
};
serverCapabilities.ImplementationProvider = true;

return serverCapabilities;
}

Expand Down
Loading