Skip to content

Commit c60c9cc

Browse files
authored
Merge pull request #56051 from dibarbet/lsp_editor_features
Move VS lsp client implementation to EditorFeatures for VSMac
2 parents e3a9be0 + e519d85 commit c60c9cc

File tree

75 files changed

+196
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+196
-164
lines changed

src/EditorFeatures/Core/EditorFeaturesResources.resx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,4 +1119,8 @@ Do you want to proceed?</value>
11191119
<data name="Execute_Suggested_Action" xml:space="preserve">
11201120
<value>Execute Suggested Action</value>
11211121
</data>
1122+
<data name="Language_client_initialization_failed" xml:space="preserve">
1123+
<value>{0} failed to initialize. Status = {1}. Exception = {2}</value>
1124+
<comment>{0} is the language server name. Status is the status of the initialization. Exception is the exception encountered during initialization.</comment>
1125+
</data>
11221126
</root>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System.IO;
99
using System.Threading;
1010
using System.Threading.Tasks;
11-
using Microsoft.CodeAnalysis;
1211
using Microsoft.CodeAnalysis.Diagnostics;
1312
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
1413
using Microsoft.CodeAnalysis.LanguageServer;
@@ -21,7 +20,7 @@
2120
using Roslyn.Utilities;
2221
using StreamJsonRpc;
2322

24-
namespace Microsoft.VisualStudio.LanguageServices.Implementation.LanguageClient
23+
namespace Microsoft.CodeAnalysis.Editor.Implementation.LanguageClient
2524
{
2625
internal abstract partial class AbstractInProcLanguageClient : ILanguageClient, ILanguageServerFactory, ICapabilitiesProvider
2726
{
@@ -224,7 +223,7 @@ public ILanguageServerTarget Create(
224223
public Task<InitializationFailureContext?> OnServerInitializeFailedAsync(ILanguageClientInitializationInfo initializationState)
225224
{
226225
var initializationFailureContext = new InitializationFailureContext();
227-
initializationFailureContext.FailureMessage = string.Format(ServicesVSResources.Language_client_initialization_failed,
226+
initializationFailureContext.FailureMessage = string.Format(EditorFeaturesResources.Language_client_initialization_failed,
228227
Name, initializationState.StatusMessage, initializationState.InitializationException?.ToString());
229228
return Task.FromResult<InitializationFailureContext?>(initializationFailureContext);
230229
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using Microsoft.VisualStudio.LanguageServer.Protocol;
1717
using Microsoft.VisualStudio.Utilities;
1818

19-
namespace Microsoft.VisualStudio.LanguageServices.Implementation.LanguageClient
19+
namespace Microsoft.CodeAnalysis.Editor.Implementation.LanguageClient
2020
{
2121
/// <summary>
2222
/// Language client responsible for handling C# / VB / F# LSP requests in any scenario (both local and codespaces).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using Microsoft.VisualStudio.LanguageServer.Client;
1818
using Microsoft.VisualStudio.Threading;
1919

20-
namespace Microsoft.VisualStudio.LanguageServices.Implementation.LanguageClient
20+
namespace Microsoft.CodeAnalysis.Editor.Implementation.LanguageClient
2121
{
2222
// unfortunately, we can't implement this on LanguageServerClient since this uses MEF v2 and
2323
// ILanguageClient requires MEF v1 and two can't be mixed exported in 1 class.

src/Features/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHandler.cs renamed to src/EditorFeatures/Core/Implementation/LanguageServer/Handlers/CodeActions/CodeActionResolveHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler
2626
/// system allows the basic code action data to be computed quickly, and the
2727
/// complex data, such as edits and commands, to be computed only when necessary
2828
/// (i.e. when hovering/previewing a code action).
29+
///
30+
/// TODO - This must be moved to the MS.CA.LanguageServer.Protocol project once the
31+
/// EditorFeatures references in <see cref="RunCodeActionHandler"/> are removed.
32+
/// See https://github.com/dotnet/roslyn/issues/55142
2933
/// </summary>
3034
internal class CodeActionResolveHandler : IRequestHandler<LSP.CodeAction, LSP.CodeAction>
3135
{

src/Features/LanguageServer/Protocol/Handler/CodeActions/CodeActionsHandler.cs renamed to src/EditorFeatures/Core/Implementation/LanguageServer/Handlers/CodeActions/CodeActionsHandler.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ namespace Microsoft.CodeAnalysis.LanguageServer.Handler
1717
/// Handles the initial request for code actions. Leaves the Edit and Command properties
1818
/// of the returned VSCodeActions blank, as these properties should be populated by the
1919
/// CodeActionsResolveHandler only when the user requests them.
20+
///
21+
/// TODO - This must be moved to the MS.CA.LanguageServer.Protocol project once the
22+
/// EditorFeatures references in <see cref="RunCodeActionHandler"/> are removed.
23+
/// See https://github.com/dotnet/roslyn/issues/55142
2024
/// </summary>
2125
internal class CodeActionsHandler : IRequestHandler<LSP.CodeActionParams, LSP.CodeAction[]>
2226
{

0 commit comments

Comments
 (0)