提交 f7a2fef5 编写于 作者: D David Barbet

Modify liveshare handlers to export based on language.

上级 a3d4287a
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.LanguageServices.LiveShare.CustomProtocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.ClassificationsName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynClassificationsHandler : ClassificationsHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, RoslynMethods.ClassificationsName)]
internal class CSharpClassificationsHandler : ClassificationsHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, RoslynMethods.ClassificationsName)]
internal class VisualBasicClassificationsHandler : ClassificationsHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, RoslynMethods.ClassificationsName)]
internal class TypeScriptClassificationsHandler : ClassificationsHandler
{
}
}
......@@ -19,7 +19,6 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare
/// Note, this must return object instead of ClassificationSpan b/c liveshare uses dynamic to convert handler results.
/// Unfortunately, ClassificationSpan is an internal type and cannot be defined in the external access layer.
/// </summary>
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.ClassificationsName)]
internal class ClassificationsHandler : ILspRequestHandler<ClassificationParams, object[], Solution>
{
public async Task<object[]> HandleAsync(ClassificationParams request, RequestContext<Solution> requestContext, CancellationToken cancellationToken)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
......@@ -9,6 +10,7 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[Export(LiveShareConstants.RoslynContractName, typeof(ILspNotificationProvider))]
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.GetDocumentDiagnosticsName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynDiagnosticsHandler : DiagnosticsHandler
{
[ImportingConstructor]
......@@ -18,6 +20,42 @@ public RoslynDiagnosticsHandler(IDiagnosticService diagnosticService)
}
}
[Export(LiveShareConstants.CSharpContractName, typeof(ILspNotificationProvider))]
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.GetDocumentDiagnosticsName)]
internal class CSharpDiagnosticsHandler : DiagnosticsHandler
{
[ImportingConstructor]
public CSharpDiagnosticsHandler(IDiagnosticService diagnosticService)
: base(diagnosticService)
{
}
}
[Export(LiveShareConstants.VisualBasicContractName, typeof(ILspNotificationProvider))]
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.GetDocumentDiagnosticsName)]
internal class VisualBasicDiagnosticsHandler : DiagnosticsHandler
{
[ImportingConstructor]
public VisualBasicDiagnosticsHandler(IDiagnosticService diagnosticService)
: base(diagnosticService)
{
}
}
[Export(LiveShareConstants.TypeScriptContractName, typeof(ILspNotificationProvider))]
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.GetDocumentDiagnosticsName)]
internal class TypeScriptDiagnosticsHandler : DiagnosticsHandler
{
[ImportingConstructor]
public TypeScriptDiagnosticsHandler(IDiagnosticService diagnosticService)
: base(diagnosticService)
{
}
}
/// <summary>
/// <see cref="LiveShareConstants.RoslynLSPSDKContractName"/> is only used for typescript.
/// </summary>
[Export(LiveShareConstants.RoslynLSPSDKContractName, typeof(ILspNotificationProvider))]
[ExportLspRequestHandler(LiveShareConstants.RoslynLSPSDKContractName, Methods.GetDocumentDiagnosticsName)]
internal class RoslynLSPSDKDiagnosticsHandler : DiagnosticsHandler
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentReferencesName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynFindAllReferencesHandler : FindAllReferencesHandler
{
[ImportingConstructor]
public RoslynFindAllReferencesHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentReferencesName)]
internal class CSharpFindAllReferencesHandler : FindAllReferencesHandler
{
[ImportingConstructor]
public CSharpFindAllReferencesHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentReferencesName)]
internal class VisualBasicFindAllReferencesHandler : FindAllReferencesHandler
{
[ImportingConstructor]
public VisualBasicFindAllReferencesHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentReferencesName)]
internal class TypeScriptFindAllReferencesHandler : FindAllReferencesHandler
{
[ImportingConstructor]
public TypeScriptFindAllReferencesHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -20,12 +19,10 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, LSP.Methods.TextDocumentReferencesName)]
internal class FindAllReferencesHandler : ILspRequestHandler<LSP.ReferenceParams, object[], Solution>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public FindAllReferencesHandler(IThreadingContext threadingContext)
{
_threadingContext = threadingContext;
......@@ -50,7 +47,7 @@ public async Task<object[]> HandleAsync(LSP.ReferenceParams request, RequestCont
// This is not great for us and ideally we should ask for a Roslyn API where we can make this call without blocking the UI.
if (VsTaskLibraryHelper.ServiceInstance != null)
{
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
await _threadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
}
await findUsagesService.FindReferencesAsync(document, position, context).ConfigureAwait(false);
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using System;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDefinitionName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynGoToDefinitionWithFarHandler : GotoDefinitionHandler
{
[ImportingConstructor]
public RoslynGoToDefinitionWithFarHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService) : base(metadataAsSourceService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentDefinitionName)]
internal class CSharpGoToDefinitionWithFarHandler : GotoDefinitionHandler
{
[ImportingConstructor]
public CSharpGoToDefinitionWithFarHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService) : base(metadataAsSourceService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentDefinitionName)]
internal class VisualBasicGoToDefinitionWithFarHandler : GotoDefinitionHandler
{
[ImportingConstructor]
public VisualBasicGoToDefinitionWithFarHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService) : base(metadataAsSourceService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDefinitionName)]
internal class TypeScriptGoToDefinitionWithFarHandler : GotoDefinitionHandler
{
[ImportingConstructor]
public TypeScriptGoToDefinitionWithFarHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService) : base(metadataAsSourceService)
{
}
}
}
......@@ -23,7 +23,6 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare
/// cone to the vslsexternal scheme.
/// This lives in external access because it has a dependency on FAR, which requires the UI thread.
/// </summary>
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, LSP.Methods.TextDocumentDefinitionName)]
internal class GotoDefinitionHandler : ILspRequestHandler<LSP.TextDocumentPositionParams, object, Solution>
{
private readonly IMetadataAsSourceFileService _metadataAsSourceService;
......@@ -31,7 +30,6 @@ internal class GotoDefinitionHandler : ILspRequestHandler<LSP.TextDocumentPositi
// These languages don't provide an IGoToDefinitionService implementation that will return definitions. We'll use IFindUsagesService instead.
private static readonly string[] s_findUsagesServiceLanguages = new string[] { LiveShareConstants.TypeScriptLanguageName };
[ImportingConstructor]
public GotoDefinitionHandler([Import(AllowDefault = true)] IMetadataAsSourceFileService metadataAsSourceService)
{
this._metadataAsSourceService = metadataAsSourceService;
......
......@@ -9,5 +9,9 @@ class LiveShareConstants
// The service name for an LSP server implemented using Roslyn designed to be used with the LSP SDK client
public const string RoslynLSPSDKContractName = "RoslynLSPSDK";
public const string TypeScriptLanguageName = "TypeScript";
public const string CSharpContractName = "CSharp";
public const string VisualBasicContractName = "VisualBasic";
public const string TypeScriptContractName = "TypeScript";
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
......@@ -7,7 +8,6 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.LoadName)]
internal class LoadHandler : ILspRequestHandler, ILspRequestHandler<object, object>
{
public Task<object> HandleAsync(object request, RequestContext requestContext, CancellationToken cancellationToken)
......@@ -15,4 +15,25 @@ public Task<object> HandleAsync(object request, RequestContext requestContext, C
return Task.FromResult<object>(null);
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.LoadName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynLoadHandler : LoadHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.LoadName)]
internal class CSharpLoadHandler : LoadHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.LoadName)]
internal class VisualBasicLoadHandler : LoadHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.LoadName)]
internal class TypeScriptLoadHandler : LoadHandler
{
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.VisualStudio.LanguageServices.LiveShare.CustomProtocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.CodeActionPreviewName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynPreviewCodeActionsHandler : PreviewCodeActionsHandler
{
[ImportingConstructor]
public RoslynPreviewCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService) : base(codeFixService, codeRefactoringService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, RoslynMethods.CodeActionPreviewName)]
internal class CSharpPreviewCodeActionsHandler : PreviewCodeActionsHandler
{
[ImportingConstructor]
public CSharpPreviewCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService) : base(codeFixService, codeRefactoringService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, RoslynMethods.CodeActionPreviewName)]
internal class VisualBasicPreviewCodeActionsHandler : PreviewCodeActionsHandler
{
[ImportingConstructor]
public VisualBasicPreviewCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService) : base(codeFixService, codeRefactoringService)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, RoslynMethods.CodeActionPreviewName)]
internal class TypeScriptPreviewCodeActionsHandler : PreviewCodeActionsHandler
{
[ImportingConstructor]
public TypeScriptPreviewCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService) : base(codeFixService, codeRefactoringService)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -12,16 +11,13 @@
using Microsoft.CodeAnalysis.LanguageServer.CustomProtocol;
using Microsoft.CodeAnalysis.LanguageServer.Handler;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.VisualStudio.LanguageServices.LiveShare.CustomProtocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
using LSP = Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.CodeActionPreviewName)]
internal class PreviewCodeActionsHandler : CodeActionsHandlerBase, ILspRequestHandler<RunCodeActionParams, LSP.TextEdit[], Solution>
{
[ImportingConstructor]
public PreviewCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService)
: base(codeFixService, codeRefactoringService)
{
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.LanguageServices.LiveShare.CustomProtocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.ProjectsName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynProjectsHandler : ProjectsHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, RoslynMethods.ProjectsName)]
internal class CSharpProjectsHandler : ProjectsHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, RoslynMethods.ProjectsName)]
internal class VisualBasicProjectsHandler : ProjectsHandler
{
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, RoslynMethods.ProjectsName)]
internal class TypeScriptProjectsHandler : ProjectsHandler
{
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.VisualStudio.LanguageServices.LiveShare.CustomProtocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
......@@ -15,7 +13,6 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare
/// <summary>
/// TODO - Move to lower layer once the protocol converter is figured out.
/// </summary>
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.ProjectsName)]
internal class ProjectsHandler : ILspRequestHandler<object, object[], Solution>
{
public async Task<object[]> HandleAsync(object param, RequestContext<Solution> requestContext, CancellationToken cancellationToken)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentRenameName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynRenameHandler : RenameHandler
{
[ImportingConstructor]
public RoslynRenameHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentRenameName)]
internal class CSharpRenameHandler : RenameHandler
{
[ImportingConstructor]
public CSharpRenameHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentRenameName)]
internal class VisualBasicRenameHandler : RenameHandler
{
[ImportingConstructor]
public VisualBasicRenameHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentRenameName)]
internal class TypeScriptRenameHandler : RenameHandler
{
[ImportingConstructor]
public TypeScriptRenameHandler(IThreadingContext threadingContext) : base(threadingContext)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -15,12 +13,10 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentRenameName)]
internal class RenameHandler : ILspRequestHandler<RenameParams, WorkspaceEdit, Solution>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public RenameHandler(IThreadingContext threadingContext)
{
_threadingContext = threadingContext;
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.LiveShare.LanguageServices;
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.WorkspaceExecuteCommandName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynRunCodeActionsHandler : RunCodeActionsHandler
{
[ImportingConstructor]
public RoslynRunCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService, IThreadingContext threadingContext)
: base(codeFixService, codeRefactoringService, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.WorkspaceExecuteCommandName)]
internal class CSharpRunCodeActionsHandler : RunCodeActionsHandler
{
[ImportingConstructor]
public CSharpRunCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService, IThreadingContext threadingContext)
: base(codeFixService, codeRefactoringService, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.WorkspaceExecuteCommandName)]
internal class VisualBasicRunCodeActionsHandler : RunCodeActionsHandler
{
[ImportingConstructor]
public VisualBasicRunCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService, IThreadingContext threadingContext)
: base(codeFixService, codeRefactoringService, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.WorkspaceExecuteCommandName)]
internal class TypeScriptRunCodeActionsHandler : RunCodeActionsHandler
{
[ImportingConstructor]
public TypeScriptRunCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService, IThreadingContext threadingContext)
: base(codeFixService, codeRefactoringService, threadingContext)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -20,12 +19,10 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare
/// Run code actions handler. Called when lightbulb invoked.
/// TODO - Move to CodeAnalysis.LanguageServer once the UI thread dependency is removed.
/// </summary>
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, LSP.Methods.WorkspaceExecuteCommandName)]
internal class RunCodeActionsHandler : CodeActionsHandlerBase, ILspRequestHandler<LSP.ExecuteCommandParams, object, Solution>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public RunCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService, IThreadingContext threadingContext)
: base(codeFixService, codeRefactoringService)
{
......
......@@ -14,11 +14,9 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCodeActionName)]
internal class CodeActionsHandlerShim : AbstractLiveShareHandlerShim<CodeActionParams, object[]>
{
[ImportingConstructor]
public CodeActionsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public CodeActionsHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.TextDocumentCodeActionName)
{
}
......@@ -59,4 +57,41 @@ static LiveShareCodeAction GetLiveShareCodeAction(CodeAction codeAction)
}
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCodeActionName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynCodeActionsHandlerShim : CodeActionsHandlerShim
{
[ImportingConstructor]
public RoslynCodeActionsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentCodeActionName)]
internal class CSharpCodeActionsHandlerShim : CodeActionsHandlerShim
{
[ImportingConstructor]
public CSharpCodeActionsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentCodeActionName)]
internal class VisualBasicCodeActionsHandlerShim : CodeActionsHandlerShim
{
[ImportingConstructor]
public VisualBasicCodeActionsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentCodeActionName)]
internal class TypeScriptCodeActionsHandlerShim : CodeActionsHandlerShim
{
[ImportingConstructor]
public TypeScriptCodeActionsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -9,13 +9,48 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCompletionName)]
internal class CompletionHandlerShim : AbstractLiveShareHandlerShim<CompletionParams, object>
{
[ImportingConstructor]
public CompletionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public CompletionHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.TextDocumentCompletionName)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCompletionName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynCompletionHandlerShim : CompletionHandlerShim
{
[ImportingConstructor]
public RoslynCompletionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentCompletionName)]
internal class CSharpCompletionHandlerShim : CompletionHandlerShim
{
[ImportingConstructor]
public CSharpCompletionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentCompletionName)]
internal class VisualBasicCompletionHandlerShim : CompletionHandlerShim
{
[ImportingConstructor]
public VisualBasicCompletionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentCompletionName)]
internal class TypeScriptCompletionHandlerShim : CompletionHandlerShim
{
[ImportingConstructor]
public TypeScriptCompletionHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -9,13 +9,48 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCompletionResolveName)]
internal class CompletionResolverHandlerShim : AbstractLiveShareHandlerShim<CompletionItem, CompletionItem>
{
[ImportingConstructor]
public CompletionResolverHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public CompletionResolverHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.TextDocumentCompletionResolveName)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCompletionResolveName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynCompletionResolverHandlerShim : CompletionResolverHandlerShim
{
[ImportingConstructor]
public RoslynCompletionResolverHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentCompletionResolveName)]
internal class CSharpCompletionResolverHandlerShim : CompletionResolverHandlerShim
{
[ImportingConstructor]
public CSharpCompletionResolverHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentCompletionResolveName)]
internal class VisualBasicCompletionResolverHandlerShim : CompletionResolverHandlerShim
{
[ImportingConstructor]
public VisualBasicCompletionResolverHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentCompletionResolveName)]
internal class TypeScriptCompletionResolverHandlerShim : CompletionResolverHandlerShim
{
[ImportingConstructor]
public TypeScriptCompletionResolverHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -9,13 +9,48 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDocumentHighlightName)]
internal class DocumentHighlightHandlerShim : AbstractLiveShareHandlerShim<TextDocumentPositionParams, DocumentHighlight[]>
{
[ImportingConstructor]
public DocumentHighlightHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public DocumentHighlightHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.TextDocumentDocumentHighlightName)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDocumentHighlightName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynDocumentHighlightHandlerShim : DocumentHighlightHandlerShim
{
[ImportingConstructor]
public RoslynDocumentHighlightHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentDocumentHighlightName)]
internal class CSharpDocumentHighlightHandlerShim : DocumentHighlightHandlerShim
{
[ImportingConstructor]
public CSharpDocumentHighlightHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentDocumentHighlightName)]
internal class VisualBasicDocumentHighlightHandlerShim : DocumentHighlightHandlerShim
{
[ImportingConstructor]
public VisualBasicDocumentHighlightHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDocumentHighlightName)]
internal class TypeScriptDocumentHighlightHandlerShim : DocumentHighlightHandlerShim
{
[ImportingConstructor]
public TypeScriptDocumentHighlightHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -13,11 +13,9 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDocumentSymbolName)]
internal class DocumentSymbolsHandlerShim : AbstractLiveShareHandlerShim<DocumentSymbolParams, SymbolInformation[]>
{
[ImportingConstructor]
public DocumentSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public DocumentSymbolsHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.TextDocumentDocumentSymbolName)
{
}
......@@ -38,4 +36,41 @@ public override async Task<SymbolInformation[]> HandleAsync(DocumentSymbolParams
return response?.Select(obj => (SymbolInformation)obj).ToArray();
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDocumentSymbolName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim
{
[ImportingConstructor]
public RoslynDocumentSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentDocumentSymbolName)]
internal class CSharpDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim
{
[ImportingConstructor]
public CSharpDocumentSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentDocumentSymbolName)]
internal class VisualBasicDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim
{
[ImportingConstructor]
public VisualBasicDocumentSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDocumentSymbolName)]
internal class TypeScriptDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim
{
[ImportingConstructor]
public TypeScriptDocumentSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -13,13 +13,11 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentImplementationName)]
internal class FindImplementationsHandlerShim : AbstractLiveShareHandlerShim<TextDocumentPositionParams, object>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public FindImplementationsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
public FindImplementationsHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
: base(requestHandlers, Methods.TextDocumentImplementationName)
{
_threadingContext = threadingContext;
......@@ -32,4 +30,41 @@ public override async Task<object> HandleAsync(TextDocumentPositionParams param,
return await base.HandleAsync(param, requestContext, cancellationToken).ConfigureAwait(false);
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentImplementationName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynFindImplementationsHandlerShim : FindImplementationsHandlerShim
{
[ImportingConstructor]
public RoslynFindImplementationsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentImplementationName)]
internal class CSharpFindImplementationsHandlerShim : FindImplementationsHandlerShim
{
[ImportingConstructor]
public CSharpFindImplementationsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentImplementationName)]
internal class VisualBasicFindImplementationsHandlerShim : FindImplementationsHandlerShim
{
[ImportingConstructor]
public VisualBasicFindImplementationsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentImplementationName)]
internal class TypeScriptFindImplementationsHandlerShim : FindImplementationsHandlerShim
{
[ImportingConstructor]
public TypeScriptFindImplementationsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
}
......@@ -13,13 +13,11 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentFormattingName)]
internal class FormatDocumentHandlerShim : AbstractLiveShareHandlerShim<DocumentFormattingParams, TextEdit[]>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public FormatDocumentHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
public FormatDocumentHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
: base(requestHandlers, Methods.TextDocumentFormattingName)
{
_threadingContext = threadingContext;
......@@ -32,4 +30,41 @@ public override async Task<TextEdit[]> HandleAsync(DocumentFormattingParams para
return await base.HandleAsync(param, requestContext, cancellationToken).ConfigureAwait(false);
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentFormattingName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynFormatDocumentHandlerShim : FormatDocumentHandlerShim
{
[ImportingConstructor]
public RoslynFormatDocumentHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentFormattingName)]
internal class CSharpFormatDocumentHandlerShim : FormatDocumentHandlerShim
{
[ImportingConstructor]
public CSharpFormatDocumentHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentFormattingName)]
internal class VisualBasicFormatDocumentHandlerShim : FormatDocumentHandlerShim
{
[ImportingConstructor]
public VisualBasicFormatDocumentHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentFormattingName)]
internal class TypeScriptFormatDocumentHandlerShim : FormatDocumentHandlerShim
{
[ImportingConstructor]
public TypeScriptFormatDocumentHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
}
......@@ -13,13 +13,11 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentOnTypeFormattingName)]
internal class FormatDocumentOnTypeHandlerShim : AbstractLiveShareHandlerShim<DocumentOnTypeFormattingParams, TextEdit[]>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public FormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
public FormatDocumentOnTypeHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
: base(requestHandlers, Methods.TextDocumentOnTypeFormattingName)
{
_threadingContext = threadingContext;
......@@ -32,4 +30,41 @@ public override async Task<TextEdit[]> HandleAsync(DocumentOnTypeFormattingParam
return await base.HandleAsync(param, requestContext, cancellationToken).ConfigureAwait(false);
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentOnTypeFormattingName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim
{
[ImportingConstructor]
public RoslynFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentOnTypeFormattingName)]
internal class CSharpFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim
{
[ImportingConstructor]
public CSharpFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentOnTypeFormattingName)]
internal class VisualBasicFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim
{
[ImportingConstructor]
public VisualBasicFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentOnTypeFormattingName)]
internal class TypeScriptFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim
{
[ImportingConstructor]
public TypeScriptFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
}
......@@ -13,13 +13,11 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentRangeFormattingName)]
internal class FormatDocumentRangeHandlerShim : AbstractLiveShareHandlerShim<DocumentRangeFormattingParams, TextEdit[]>
{
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public FormatDocumentRangeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
public FormatDocumentRangeHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext)
: base(requestHandlers, Methods.TextDocumentRangeFormattingName)
{
_threadingContext = threadingContext;
......@@ -32,4 +30,41 @@ public override async Task<TextEdit[]> HandleAsync(DocumentRangeFormattingParams
return await base.HandleAsync(param, requestContext, cancellationToken).ConfigureAwait(false);
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentRangeFormattingName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim
{
[ImportingConstructor]
public RoslynFormatDocumentRangeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentRangeFormattingName)]
internal class CSharpFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim
{
[ImportingConstructor]
public CSharpFormatDocumentRangeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentRangeFormattingName)]
internal class VisualBasicFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim
{
[ImportingConstructor]
public VisualBasicFormatDocumentRangeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentRangeFormattingName)]
internal class TypeScriptFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim
{
[ImportingConstructor]
public TypeScriptFormatDocumentRangeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext)
{
}
}
}
......@@ -9,13 +9,48 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.InitializeName)]
internal class InitializeHandlerShim : AbstractLiveShareHandlerShim<InitializeParams, InitializeResult>
{
[ImportingConstructor]
public InitializeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public InitializeHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.InitializeName)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.InitializeName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynInitializeHandlerShim : InitializeHandlerShim
{
[ImportingConstructor]
public RoslynInitializeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.InitializeName)]
internal class CSharpInitializeHandlerShim : InitializeHandlerShim
{
[ImportingConstructor]
public CSharpInitializeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.InitializeName)]
internal class VisualBasicInitializeHandlerShim : InitializeHandlerShim
{
[ImportingConstructor]
public VisualBasicInitializeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.InitializeName)]
internal class TypeScriptInitializeHandlerShim : InitializeHandlerShim
{
[ImportingConstructor]
public TypeScriptInitializeHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -9,13 +9,48 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentSignatureHelpName)]
internal class SignatureHelpHandlerShim : AbstractLiveShareHandlerShim<TextDocumentPositionParams, SignatureHelp>
{
[ImportingConstructor]
public SignatureHelpHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public SignatureHelpHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.TextDocumentSignatureHelpName)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentSignatureHelpName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynSignatureHelpHandlerShim : SignatureHelpHandlerShim
{
[ImportingConstructor]
public RoslynSignatureHelpHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentSignatureHelpName)]
internal class CSharpSignatureHelpHandlerShim : SignatureHelpHandlerShim
{
[ImportingConstructor]
public CSharpSignatureHelpHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentSignatureHelpName)]
internal class VisualBasicSignatureHelpHandlerShim : SignatureHelpHandlerShim
{
[ImportingConstructor]
public VisualBasicSignatureHelpHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentSignatureHelpName)]
internal class TypeScriptSignatureHelpHandlerShim : SignatureHelpHandlerShim
{
[ImportingConstructor]
public TypeScriptSignatureHelpHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
......@@ -9,13 +9,48 @@
namespace Microsoft.VisualStudio.LanguageServices.LiveShare
{
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.WorkspaceSymbolName)]
internal class WorkspaceSymbolsHandlerShim : AbstractLiveShareHandlerShim<WorkspaceSymbolParams, SymbolInformation[]>
{
[ImportingConstructor]
public WorkspaceSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
public WorkspaceSymbolsHandlerShim(IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers)
: base(requestHandlers, Methods.WorkspaceSymbolName)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.WorkspaceSymbolName)]
[Obsolete("Used for backwards compatibility with old liveshare clients.")]
internal class RoslynWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim
{
[ImportingConstructor]
public RoslynWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.WorkspaceSymbolName)]
internal class CSharpWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim
{
[ImportingConstructor]
public CSharpWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.WorkspaceSymbolName)]
internal class VisualBasicWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim
{
[ImportingConstructor]
public VisualBasicWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
[ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.WorkspaceSymbolName)]
internal class TypeScriptWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim
{
[ImportingConstructor]
public TypeScriptWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable<Lazy<IRequestHandler, IRequestHandlerMetadata>> requestHandlers) : base(requestHandlers)
{
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册