diff --git a/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..79b2a60407c12e4e72c9698e2f16bdbf5c8088d0 --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.Exports.cs @@ -0,0 +1,29 @@ +// 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 + { + } +} diff --git a/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs b/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs index 7d0a0b8db4217fe86c9e7aedf89b8baa0e369d83..357e22cc84ded3d473238005633da80d408972d5 100644 --- a/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/ClassificationsHandler.cs @@ -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. /// - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.ClassificationsName)] internal class ClassificationsHandler : ILspRequestHandler { public async Task HandleAsync(ClassificationParams request, RequestContext requestContext, CancellationToken cancellationToken) diff --git a/src/VisualStudio/LiveShare/Impl/DiagnosticHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/DiagnosticHandler.Exports.cs index a9cf1480f7bdc476959b6246abbb6f8d0ba6bdc1..5b1061a8c6c1e79654cb8ee1fe21958213798bfb 100644 --- a/src/VisualStudio/LiveShare/Impl/DiagnosticHandler.Exports.cs +++ b/src/VisualStudio/LiveShare/Impl/DiagnosticHandler.Exports.cs @@ -1,5 +1,6 @@ // 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) + { + } + } + + /// + /// is only used for typescript. + /// [Export(LiveShareConstants.RoslynLSPSDKContractName, typeof(ILspNotificationProvider))] [ExportLspRequestHandler(LiveShareConstants.RoslynLSPSDKContractName, Methods.GetDocumentDiagnosticsName)] internal class RoslynLSPSDKDiagnosticsHandler : DiagnosticsHandler diff --git a/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..4269707c22d45ec5db80a5718806d37eb019554b --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.Exports.cs @@ -0,0 +1,47 @@ +// 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) + { + } + } +} diff --git a/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.cs b/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.cs index f1424a9f25a33691951cb3701d31ac4fbc25a31c..1093cb21aabe2dee1443cc8c95c8c4a8cd471d65 100644 --- a/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/FindAllReferencesHandler.cs @@ -1,7 +1,6 @@ // 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 { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] public FindAllReferencesHandler(IThreadingContext threadingContext) { _threadingContext = threadingContext; @@ -50,7 +47,7 @@ public async Task 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); diff --git a/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..3404ad4d65cd2c892cd1210abdc7e1adbd149b82 --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.Exports.cs @@ -0,0 +1,47 @@ +// 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) + { + } + } +} diff --git a/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.cs b/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.cs index ccd171de8ea4313a9737d3c6d3007506174169dc..1b76adbbc66cfe91f5a554fade6cceb360ca05cb 100644 --- a/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/GoToDefintionWithFarHandler.cs @@ -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. /// - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, LSP.Methods.TextDocumentDefinitionName)] internal class GotoDefinitionHandler : ILspRequestHandler { private readonly IMetadataAsSourceFileService _metadataAsSourceService; @@ -31,7 +30,6 @@ internal class GotoDefinitionHandler : ILspRequestHandler { public Task HandleAsync(object request, RequestContext requestContext, CancellationToken cancellationToken) @@ -15,4 +15,25 @@ public Task HandleAsync(object request, RequestContext requestContext, C return Task.FromResult(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 + { + } } diff --git a/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..7b762485bd123cd8c62ea730623d572c6563b2b6 --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.Exports.cs @@ -0,0 +1,48 @@ +// 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) + { + } + } +} diff --git a/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.cs b/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.cs index 57d3b94d7822b62e999be9dbc0029590a1cfb726..c019e5ed5d28e168363f7b4b676bda0457b8096e 100644 --- a/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/PreviewCodeActionsHandler.cs @@ -1,6 +1,5 @@ // 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 { - [ImportingConstructor] public PreviewCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService) : base(codeFixService, codeRefactoringService) { diff --git a/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..f143ab7e86d8261dbb0ccfb500ce8c3f41072a97 --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/ProjectsHandler.Exports.cs @@ -0,0 +1,29 @@ +// 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 + { + } +} diff --git a/src/VisualStudio/LiveShare/Impl/ProjectsHandler.cs b/src/VisualStudio/LiveShare/Impl/ProjectsHandler.cs index b9d438e4459ae2b374c93bc8ad5f3fa585f19614..005b998e4c12c5f5ca9e0e6a87525c799f14314b 100644 --- a/src/VisualStudio/LiveShare/Impl/ProjectsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/ProjectsHandler.cs @@ -1,13 +1,11 @@ // 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 /// /// TODO - Move to lower layer once the protocol converter is figured out. /// - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, RoslynMethods.ProjectsName)] internal class ProjectsHandler : ILspRequestHandler { public async Task HandleAsync(object param, RequestContext requestContext, CancellationToken cancellationToken) diff --git a/src/VisualStudio/LiveShare/Impl/RenameHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/RenameHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..a5875814f7f060ae96508951dc61970082d682d2 --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/RenameHandler.Exports.cs @@ -0,0 +1,47 @@ +// 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) + { + } + } +} diff --git a/src/VisualStudio/LiveShare/Impl/RenameHandler.cs b/src/VisualStudio/LiveShare/Impl/RenameHandler.cs index 4a245f0da4aa8370a704036e7fb353810b6a79f9..2c223aac37132e6977d77aa66fe8b6f158e4c72b 100644 --- a/src/VisualStudio/LiveShare/Impl/RenameHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/RenameHandler.cs @@ -1,7 +1,5 @@ // 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 { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] public RenameHandler(IThreadingContext threadingContext) { _threadingContext = threadingContext; diff --git a/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.Exports.cs b/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.Exports.cs new file mode 100644 index 0000000000000000000000000000000000000000..7183305f24b6d642f27a3080ff0e6267f31da96a --- /dev/null +++ b/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.Exports.cs @@ -0,0 +1,53 @@ +// 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) + { + } + } +} diff --git a/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.cs b/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.cs index 3ec14d3156dac6b167c59d3a4e95597ef647e0b8..2dae0293496cf1c70feffead167c2954d1f88e3b 100644 --- a/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.cs +++ b/src/VisualStudio/LiveShare/Impl/RunCodeActionsHandler.cs @@ -1,6 +1,5 @@ // 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. /// - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, LSP.Methods.WorkspaceExecuteCommandName)] internal class RunCodeActionsHandler : CodeActionsHandlerBase, ILspRequestHandler { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] public RunCodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringService codeRefactoringService, IThreadingContext threadingContext) : base(codeFixService, codeRefactoringService) { diff --git a/src/VisualStudio/LiveShare/Impl/Shims/CodeActionsHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/CodeActionsHandlerShim.cs index 3bb27e7809bb6397093e849d429ca4751d52d408..57468d7d2bc1d4168501a81594c8c31b00761664 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/CodeActionsHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/CodeActionsHandlerShim.cs @@ -14,11 +14,9 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCodeActionName)] internal class CodeActionsHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public CodeActionsHandlerShim([ImportMany] IEnumerable> requestHandlers) + public CodeActionsHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentCodeActionName)] + internal class CSharpCodeActionsHandlerShim : CodeActionsHandlerShim + { + [ImportingConstructor] + public CSharpCodeActionsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentCodeActionName)] + internal class VisualBasicCodeActionsHandlerShim : CodeActionsHandlerShim + { + [ImportingConstructor] + public VisualBasicCodeActionsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentCodeActionName)] + internal class TypeScriptCodeActionsHandlerShim : CodeActionsHandlerShim + { + [ImportingConstructor] + public TypeScriptCodeActionsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/CompletionHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/CompletionHandlerShim.cs index c61afac61e94f6204a4cb4222a672a980502d146..b56a2faa4fae04d8a53b2d675b4174498a59f310 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/CompletionHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/CompletionHandlerShim.cs @@ -9,13 +9,48 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCompletionName)] internal class CompletionHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public CompletionHandlerShim([ImportMany] IEnumerable> requestHandlers) + public CompletionHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentCompletionName)] + internal class CSharpCompletionHandlerShim : CompletionHandlerShim + { + [ImportingConstructor] + public CSharpCompletionHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentCompletionName)] + internal class VisualBasicCompletionHandlerShim : CompletionHandlerShim + { + [ImportingConstructor] + public VisualBasicCompletionHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentCompletionName)] + internal class TypeScriptCompletionHandlerShim : CompletionHandlerShim + { + [ImportingConstructor] + public TypeScriptCompletionHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/CompletionResolverHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/CompletionResolverHandlerShim.cs index ff8ea740d462c1c81566fdd8609476cfa79046b4..1ff56320a4d3a16660dd0d6679eedffc0ae56019 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/CompletionResolverHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/CompletionResolverHandlerShim.cs @@ -9,13 +9,48 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentCompletionResolveName)] internal class CompletionResolverHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public CompletionResolverHandlerShim([ImportMany] IEnumerable> requestHandlers) + public CompletionResolverHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentCompletionResolveName)] + internal class CSharpCompletionResolverHandlerShim : CompletionResolverHandlerShim + { + [ImportingConstructor] + public CSharpCompletionResolverHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentCompletionResolveName)] + internal class VisualBasicCompletionResolverHandlerShim : CompletionResolverHandlerShim + { + [ImportingConstructor] + public VisualBasicCompletionResolverHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentCompletionResolveName)] + internal class TypeScriptCompletionResolverHandlerShim : CompletionResolverHandlerShim + { + [ImportingConstructor] + public TypeScriptCompletionResolverHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/DocumentHighlightHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/DocumentHighlightHandlerShim.cs index dc2f81ce7553c8c0c6e89a0a3449da90a90b6cae..f0507e13ea51fadbc92fe4b8845790ccb725858d 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/DocumentHighlightHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/DocumentHighlightHandlerShim.cs @@ -9,13 +9,48 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDocumentHighlightName)] internal class DocumentHighlightHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public DocumentHighlightHandlerShim([ImportMany] IEnumerable> requestHandlers) + public DocumentHighlightHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentDocumentHighlightName)] + internal class CSharpDocumentHighlightHandlerShim : DocumentHighlightHandlerShim + { + [ImportingConstructor] + public CSharpDocumentHighlightHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentDocumentHighlightName)] + internal class VisualBasicDocumentHighlightHandlerShim : DocumentHighlightHandlerShim + { + [ImportingConstructor] + public VisualBasicDocumentHighlightHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDocumentHighlightName)] + internal class TypeScriptDocumentHighlightHandlerShim : DocumentHighlightHandlerShim + { + [ImportingConstructor] + public TypeScriptDocumentHighlightHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/DocumentSymbolsHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/DocumentSymbolsHandlerShim.cs index 5b9e5a652ddf7713d493dafbd707c00f496fba14..83a419cb04b9fe4fde366c2dd9b2944bf52be0c0 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/DocumentSymbolsHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/DocumentSymbolsHandlerShim.cs @@ -13,11 +13,9 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentDocumentSymbolName)] internal class DocumentSymbolsHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public DocumentSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) + public DocumentSymbolsHandlerShim(IEnumerable> requestHandlers) : base(requestHandlers, Methods.TextDocumentDocumentSymbolName) { } @@ -38,4 +36,41 @@ public override async Task 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentDocumentSymbolName)] + internal class CSharpDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim + { + [ImportingConstructor] + public CSharpDocumentSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentDocumentSymbolName)] + internal class VisualBasicDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim + { + [ImportingConstructor] + public VisualBasicDocumentSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentDocumentSymbolName)] + internal class TypeScriptDocumentSymbolsHandlerShim : DocumentSymbolsHandlerShim + { + [ImportingConstructor] + public TypeScriptDocumentSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/FindImplementationsHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/FindImplementationsHandlerShim.cs index 5b2cc957347aae00566fbe8504486fb932fbb114..9db55e70959fb48933663cdca9e253aa78c4045a 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/FindImplementationsHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/FindImplementationsHandlerShim.cs @@ -13,13 +13,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentImplementationName)] internal class FindImplementationsHandlerShim : AbstractLiveShareHandlerShim { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] - public FindImplementationsHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) + public FindImplementationsHandlerShim(IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, Methods.TextDocumentImplementationName) { _threadingContext = threadingContext; @@ -32,4 +30,41 @@ public override async Task 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> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentImplementationName)] + internal class CSharpFindImplementationsHandlerShim : FindImplementationsHandlerShim + { + [ImportingConstructor] + public CSharpFindImplementationsHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentImplementationName)] + internal class VisualBasicFindImplementationsHandlerShim : FindImplementationsHandlerShim + { + [ImportingConstructor] + public VisualBasicFindImplementationsHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentImplementationName)] + internal class TypeScriptFindImplementationsHandlerShim : FindImplementationsHandlerShim + { + [ImportingConstructor] + public TypeScriptFindImplementationsHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentHandlerShim.cs index e7e00d4f77f5ea89a995f459e3ad01a4d322be59..afd3524411ab7cb1196ecc08626716f32b0a5923 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentHandlerShim.cs @@ -13,13 +13,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentFormattingName)] internal class FormatDocumentHandlerShim : AbstractLiveShareHandlerShim { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] - public FormatDocumentHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) + public FormatDocumentHandlerShim(IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, Methods.TextDocumentFormattingName) { _threadingContext = threadingContext; @@ -32,4 +30,41 @@ public override async Task 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> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentFormattingName)] + internal class CSharpFormatDocumentHandlerShim : FormatDocumentHandlerShim + { + [ImportingConstructor] + public CSharpFormatDocumentHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentFormattingName)] + internal class VisualBasicFormatDocumentHandlerShim : FormatDocumentHandlerShim + { + [ImportingConstructor] + public VisualBasicFormatDocumentHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentFormattingName)] + internal class TypeScriptFormatDocumentHandlerShim : FormatDocumentHandlerShim + { + [ImportingConstructor] + public TypeScriptFormatDocumentHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentOnTypeHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentOnTypeHandlerShim.cs index 94ff18bdc3cd153dc162a51980376465839854a2..9f002733211c3b5f411e8fefa5dc24b07c263ef7 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentOnTypeHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentOnTypeHandlerShim.cs @@ -13,13 +13,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentOnTypeFormattingName)] internal class FormatDocumentOnTypeHandlerShim : AbstractLiveShareHandlerShim { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] - public FormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) + public FormatDocumentOnTypeHandlerShim(IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, Methods.TextDocumentOnTypeFormattingName) { _threadingContext = threadingContext; @@ -32,4 +30,41 @@ public override async Task 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> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentOnTypeFormattingName)] + internal class CSharpFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim + { + [ImportingConstructor] + public CSharpFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentOnTypeFormattingName)] + internal class VisualBasicFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim + { + [ImportingConstructor] + public VisualBasicFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentOnTypeFormattingName)] + internal class TypeScriptFormatDocumentOnTypeHandlerShim : FormatDocumentOnTypeHandlerShim + { + [ImportingConstructor] + public TypeScriptFormatDocumentOnTypeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentRangeHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentRangeHandlerShim.cs index e0af4ab702ee294c47ab4841e6550f47ea34eea4..f563e3387e9dd065903ab88ac69d483ed1944167 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentRangeHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/FormatDocumentRangeHandlerShim.cs @@ -13,13 +13,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentRangeFormattingName)] internal class FormatDocumentRangeHandlerShim : AbstractLiveShareHandlerShim { private readonly IThreadingContext _threadingContext; - [ImportingConstructor] - public FormatDocumentRangeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) + public FormatDocumentRangeHandlerShim(IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, Methods.TextDocumentRangeFormattingName) { _threadingContext = threadingContext; @@ -32,4 +30,41 @@ public override async Task 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> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentRangeFormattingName)] + internal class CSharpFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim + { + [ImportingConstructor] + public CSharpFormatDocumentRangeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentRangeFormattingName)] + internal class VisualBasicFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim + { + [ImportingConstructor] + public VisualBasicFormatDocumentRangeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentRangeFormattingName)] + internal class TypeScriptFormatDocumentRangeHandlerShim : FormatDocumentRangeHandlerShim + { + [ImportingConstructor] + public TypeScriptFormatDocumentRangeHandlerShim([ImportMany] IEnumerable> requestHandlers, IThreadingContext threadingContext) : base(requestHandlers, threadingContext) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/InitializeHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/InitializeHandlerShim.cs index 105b5b9a2cfca5e740baf27feb6da9657061a5e8..973b1d35a12dfb51ba860a313ab99d34c5143d3c 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/InitializeHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/InitializeHandlerShim.cs @@ -9,13 +9,48 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.InitializeName)] internal class InitializeHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public InitializeHandlerShim([ImportMany] IEnumerable> requestHandlers) + public InitializeHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.InitializeName)] + internal class CSharpInitializeHandlerShim : InitializeHandlerShim + { + [ImportingConstructor] + public CSharpInitializeHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.InitializeName)] + internal class VisualBasicInitializeHandlerShim : InitializeHandlerShim + { + [ImportingConstructor] + public VisualBasicInitializeHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.InitializeName)] + internal class TypeScriptInitializeHandlerShim : InitializeHandlerShim + { + [ImportingConstructor] + public TypeScriptInitializeHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/SignatureHelpHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/SignatureHelpHandlerShim.cs index d39dffe3009a583b506ab367ec8cc11f2a56cad9..3f80d90a1ed9397200600f8d8d0821f8a13fdf1a 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/SignatureHelpHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/SignatureHelpHandlerShim.cs @@ -9,13 +9,48 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.TextDocumentSignatureHelpName)] internal class SignatureHelpHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public SignatureHelpHandlerShim([ImportMany] IEnumerable> requestHandlers) + public SignatureHelpHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.TextDocumentSignatureHelpName)] + internal class CSharpSignatureHelpHandlerShim : SignatureHelpHandlerShim + { + [ImportingConstructor] + public CSharpSignatureHelpHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.TextDocumentSignatureHelpName)] + internal class VisualBasicSignatureHelpHandlerShim : SignatureHelpHandlerShim + { + [ImportingConstructor] + public VisualBasicSignatureHelpHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.TextDocumentSignatureHelpName)] + internal class TypeScriptSignatureHelpHandlerShim : SignatureHelpHandlerShim + { + [ImportingConstructor] + public TypeScriptSignatureHelpHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } } diff --git a/src/VisualStudio/LiveShare/Impl/Shims/WorkspaceSymbolsHandlerShim.cs b/src/VisualStudio/LiveShare/Impl/Shims/WorkspaceSymbolsHandlerShim.cs index 7841a89c0a09412de4cd7c85d7f488f264df620d..21f6420afb0c3c7b774f1ecee2e62bab9438fe90 100644 --- a/src/VisualStudio/LiveShare/Impl/Shims/WorkspaceSymbolsHandlerShim.cs +++ b/src/VisualStudio/LiveShare/Impl/Shims/WorkspaceSymbolsHandlerShim.cs @@ -9,13 +9,48 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare { - [ExportLspRequestHandler(LiveShareConstants.RoslynContractName, Methods.WorkspaceSymbolName)] internal class WorkspaceSymbolsHandlerShim : AbstractLiveShareHandlerShim { - [ImportingConstructor] - public WorkspaceSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) + public WorkspaceSymbolsHandlerShim(IEnumerable> 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> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.CSharpContractName, Methods.WorkspaceSymbolName)] + internal class CSharpWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim + { + [ImportingConstructor] + public CSharpWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.VisualBasicContractName, Methods.WorkspaceSymbolName)] + internal class VisualBasicWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim + { + [ImportingConstructor] + public VisualBasicWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } + + [ExportLspRequestHandler(LiveShareConstants.TypeScriptContractName, Methods.WorkspaceSymbolName)] + internal class TypeScriptWorkspaceSymbolsHandlerShim : WorkspaceSymbolsHandlerShim + { + [ImportingConstructor] + public TypeScriptWorkspaceSymbolsHandlerShim([ImportMany] IEnumerable> requestHandlers) : base(requestHandlers) + { + } + } }