提交 9a394af1 编写于 作者: D David Barbet

Address review feedback.

上级 3d66cdfa
......@@ -10,8 +10,8 @@
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.LanguageServer.CustomProtocol;
using LSP = Microsoft.VisualStudio.LanguageServer.Protocol;
using Newtonsoft.Json.Linq;
using LSP = Microsoft.VisualStudio.LanguageServer.Protocol;
namespace Microsoft.CodeAnalysis.LanguageServer.Handler
{
......@@ -49,10 +49,7 @@ public CodeActionsHandler(ICodeFixService codeFixService, ICodeRefactoringServic
var clientSupportsWorkspaceEdits = true;
if (clientCapabilities?.Experimental is JObject clientCapabilitiesExtensions)
{
if (clientCapabilitiesExtensions.TryGetValue("supportsWorkspaceEdits", out var val))
{
clientSupportsWorkspaceEdits = val.ToObject<bool>();
}
clientSupportsWorkspaceEdits = clientCapabilitiesExtensions.SelectToken("supportsWorkspaceEdits")?.Value<bool>() ?? clientSupportsWorkspaceEdits;
}
if (clientSupportsWorkspaceEdits && operations.Length == 1 && operations.First() is ApplyChangesOperation applyChangesOperation)
......
......@@ -27,13 +27,7 @@ void M()
}";
var (solution, locations) = CreateTestSolution(markup);
var expected = CreateCommand(CSharpFeaturesResources.Use_implicit_type, locations["caret"].First());
var clientCapabilities = new LSP.ClientCapabilities()
{
Experimental = new JObject
{
{ "supportsWorkspaceEdits", false }
}
};
var clientCapabilities = CreateClientCapabilitiesWithExperimentalValue("supportsWorkspaceEdits", JToken.FromObject(false));
var results = await RunCodeActionsAsync(solution, locations["caret"].First(), clientCapabilities);
AssertCodeActionCommandsEqual(expected, results.Single());
......@@ -69,6 +63,15 @@ static void AssertRunCodeActionParamsEqual(RunCodeActionParams expected, RunCode
}
}
private static LSP.ClientCapabilities CreateClientCapabilitiesWithExperimentalValue(string experimentalProperty, JToken value)
=> new LSP.ClientCapabilities()
{
Experimental = new JObject
{
{ experimentalProperty, value }
}
};
private static LSP.CodeActionParams CreateCodeActionParams(LSP.Location caret)
=> new LSP.CodeActionParams()
{
......
......@@ -30,42 +30,42 @@ public ILanguageService CreateLanguageService(HostLanguageServices languageServi
[ExportLanguageServiceFactory(typeof(ISyntaxClassificationService), StringConstants.CSharpLspLanguageName), Shared]
internal class CSharpLspEditorClassificationFactoryService : ILanguageServiceFactory
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLspClientServiceFactory;
private readonly ClassificationTypeMap _classificationTypeMap;
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public CSharpLspEditorClassificationFactoryService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, ClassificationTypeMap classificationTypeMap, IThreadingContext threadingContext)
public CSharpLspEditorClassificationFactoryService(RoslynLspClientServiceFactory roslynLspClientServiceFactory, ClassificationTypeMap classificationTypeMap, IThreadingContext threadingContext)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLspClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
_classificationTypeMap = classificationTypeMap ?? throw new ArgumentNullException(nameof(classificationTypeMap));
_threadingContext = threadingContext;
}
public ILanguageService CreateLanguageService(HostLanguageServices languageServices)
{
return new RoslynClassificationService(_roslynLSPClientServiceFactory, languageServices.GetOriginalLanguageService<ISyntaxClassificationService>(), _classificationTypeMap, _threadingContext);
return new RoslynClassificationService(_roslynLspClientServiceFactory, languageServices.GetOriginalLanguageService<ISyntaxClassificationService>(), _classificationTypeMap, _threadingContext);
}
}
[ExportLanguageServiceFactory(typeof(ISyntaxClassificationService), StringConstants.VBLspLanguageName), Shared]
internal class VBLspEditorClassificationFactoryService : ILanguageServiceFactory
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLspClientServiceFactory;
private readonly ClassificationTypeMap _classificationTypeMap;
private readonly IThreadingContext _threadingContext;
[ImportingConstructor]
public VBLspEditorClassificationFactoryService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, ClassificationTypeMap classificationTypeMap, IThreadingContext threadingContext)
public VBLspEditorClassificationFactoryService(RoslynLspClientServiceFactory roslynLspClientServiceFactory, ClassificationTypeMap classificationTypeMap, IThreadingContext threadingContext)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLspClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
_classificationTypeMap = classificationTypeMap ?? throw new ArgumentNullException(nameof(classificationTypeMap));
_threadingContext = threadingContext;
}
public ILanguageService CreateLanguageService(HostLanguageServices languageServices)
{
return new RoslynClassificationService(_roslynLSPClientServiceFactory, languageServices.GetOriginalLanguageService<ISyntaxClassificationService>(), _classificationTypeMap, _threadingContext);
return new RoslynClassificationService(_roslynLspClientServiceFactory, languageServices.GetOriginalLanguageService<ISyntaxClassificationService>(), _classificationTypeMap, _threadingContext);
}
}
}
......@@ -17,15 +17,15 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Classification
{
internal class RoslynClassificationService : ISyntaxClassificationService
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
private readonly ISyntaxClassificationService _originalService;
private readonly ClassificationTypeMap _classificationTypeMap;
private readonly IThreadingContext _threadingContext;
public RoslynClassificationService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, ISyntaxClassificationService originalService,
public RoslynClassificationService(RoslynLspClientServiceFactory roslynLspClientServiceFactory, ISyntaxClassificationService originalService,
ClassificationTypeMap classificationTypeMap, IThreadingContext threadingContext)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
_originalService = originalService ?? throw new ArgumentNullException(nameof(originalService));
_classificationTypeMap = classificationTypeMap ?? throw new ArgumentNullException(nameof(classificationTypeMap));
_threadingContext = threadingContext;
......
......@@ -11,8 +11,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.CodeActions
internal class CSharpLspCodeActionProvider : RoslynCodeActionProvider
{
[ImportingConstructor]
public CSharpLspCodeActionProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, IDiagnosticAnalyzerService diagnosticAnalyzerService)
: base(roslynLSPClientServiceFactory, diagnosticAnalyzerService)
public CSharpLspCodeActionProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory, IDiagnosticAnalyzerService diagnosticAnalyzerService)
: base(roslynLspClientServiceFactory, diagnosticAnalyzerService)
{
}
}
......@@ -22,8 +22,8 @@ public CSharpLspCodeActionProvider(RoslynLSPClientServiceFactory roslynLSPClient
internal class VBLspCodeActionProvider : RoslynCodeActionProvider
{
[ImportingConstructor]
public VBLspCodeActionProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, IDiagnosticAnalyzerService diagnosticAnalyzerService)
: base(roslynLSPClientServiceFactory, diagnosticAnalyzerService)
public VBLspCodeActionProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory, IDiagnosticAnalyzerService diagnosticAnalyzerService)
: base(roslynLspClientServiceFactory, diagnosticAnalyzerService)
{
}
}
......
......@@ -14,12 +14,12 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.CodeActions
{
internal class RoslynCodeActionProvider : CodeRefactoringProvider
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
private readonly IDiagnosticAnalyzerService _diagnosticAnalyzerService;
public RoslynCodeActionProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, IDiagnosticAnalyzerService diagnosticAnalyzerService)
public RoslynCodeActionProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory, IDiagnosticAnalyzerService diagnosticAnalyzerService)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
_diagnosticAnalyzerService = diagnosticAnalyzerService ?? throw new ArgumentNullException(nameof(diagnosticAnalyzerService));
}
......
......@@ -9,8 +9,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Completion
internal class CSharpLspCompletionProvider : RoslynCompletionProvider
{
[ImportingConstructor]
public CSharpLspCompletionProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public CSharpLspCompletionProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......@@ -19,8 +19,8 @@ public CSharpLspCompletionProvider(RoslynLSPClientServiceFactory roslynLSPClient
internal class VBLspCompletionProvider : RoslynCompletionProvider
{
[ImportingConstructor]
public VBLspCompletionProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public VBLspCompletionProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......
......@@ -16,11 +16,11 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Completion
{
internal class RoslynCompletionProvider : CommonCompletionProvider
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
public RoslynCompletionProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
public RoslynCompletionProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
}
public override async Task ProvideCompletionsAsync(CompletionContext context)
......
......@@ -9,8 +9,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Diagnostics
internal class CSharpLspRemoteDiagnosticsService : RoslynRemoteDiagnosticsService
{
[ImportingConstructor]
public CSharpLspRemoteDiagnosticsService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public CSharpLspRemoteDiagnosticsService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......@@ -19,8 +19,8 @@ public CSharpLspRemoteDiagnosticsService(RoslynLSPClientServiceFactory roslynLSP
internal class VBLspRemoteDiagnosticsService : RoslynRemoteDiagnosticsService
{
[ImportingConstructor]
public VBLspRemoteDiagnosticsService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public VBLspRemoteDiagnosticsService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......
......@@ -13,11 +13,11 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Diagnostics
{
internal class RoslynRemoteDiagnosticsService : IRemoteDiagnosticsService
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
public RoslynRemoteDiagnosticsService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
public RoslynRemoteDiagnosticsService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
}
public async Task<ImmutableArray<Diagnostic>> GetDiagnosticsAsync(Document document, CancellationToken cancellationToken)
......
......@@ -13,17 +13,17 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.GotoDefinition
internal class CSharpLspGotoDefinitionService : RoslynGotoDefinitionService
{
[ImportingConstructor]
public CSharpLspGotoDefinitionService(IStreamingFindUsagesPresenter streamingPresenter, RoslynLSPClientServiceFactory roslynLSPClientServiceFactory,
public CSharpLspGotoDefinitionService(IStreamingFindUsagesPresenter streamingPresenter, RoslynLSPClientServiceFactory roslynLspClientServiceFactory,
RemoteLanguageServiceWorkspace remoteWorkspace, IThreadingContext threadingContext)
: base(streamingPresenter, roslynLSPClientServiceFactory, remoteWorkspace, threadingContext) { }
: base(streamingPresenter, roslynLspClientServiceFactory, remoteWorkspace, threadingContext) { }
}
[ExportLanguageService(typeof(IGoToDefinitionService), StringConstants.VBLspLanguageName), Shared]
internal class VBLspGotoDefinitionService : RoslynGotoDefinitionService
{
[ImportingConstructor]
public VBLspGotoDefinitionService(IStreamingFindUsagesPresenter streamingPresenter, RoslynLSPClientServiceFactory roslynLSPClientServiceFactory,
public VBLspGotoDefinitionService(IStreamingFindUsagesPresenter streamingPresenter, RoslynLSPClientServiceFactory roslynLspClientServiceFactory,
RemoteLanguageServiceWorkspace remoteWorkspace, IThreadingContext threadingContext)
: base(streamingPresenter, roslynLSPClientServiceFactory, remoteWorkspace, threadingContext) { }
: base(streamingPresenter, roslynLspClientServiceFactory, remoteWorkspace, threadingContext) { }
}
}*/
......@@ -29,12 +29,12 @@ internal class RoslynGotoDefinitionService : IGoToDefinitionService
public RoslynGotoDefinitionService(
IStreamingFindUsagesPresenter streamingPresenter,
RoslynLSPClientServiceFactory roslynLSPClientServiceFactory,
RoslynLSPClientServiceFactory roslynLspClientServiceFactory,
RemoteLanguageServiceWorkspace remoteWorkspace,
IThreadingContext threadingContext)
{
_streamingPresenter = streamingPresenter ?? throw new ArgumentNullException(nameof(streamingPresenter));
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
_remoteWorkspace = remoteWorkspace ?? throw new ArgumentNullException(nameof(remoteWorkspace));
}
......
......@@ -10,8 +10,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Highlights
internal class CSharpLspDocumentHighlightsService : RoslynDocumentHighlightsService
{
[ImportingConstructor]
public CSharpLspDocumentHighlightsService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public CSharpLspDocumentHighlightsService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......@@ -20,8 +20,8 @@ public CSharpLspDocumentHighlightsService(RoslynLSPClientServiceFactory roslynLS
internal class VBLspDocumentHighlightsService : RoslynDocumentHighlightsService
{
[ImportingConstructor]
public VBLspDocumentHighlightsService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public VBLspDocumentHighlightsService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......
......@@ -13,11 +13,11 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Highlights
{
internal class RoslynDocumentHighlightsService : IDocumentHighlightsService
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
public RoslynDocumentHighlightsService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
public RoslynDocumentHighlightsService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
}
public async Task<ImmutableArray<DocumentHighlights>> GetDocumentHighlightsAsync(Document document, int position, IImmutableSet<Document> documentsToSearch, CancellationToken cancellationToken)
......
......@@ -17,6 +17,7 @@
<ProjectReference Include="..\..\..\Workspaces\Core\Portable\Microsoft.CodeAnalysis.Workspaces.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Editor" Version="$(MicrosoftVisualStudioEditorVersion)" />
<PackageReference Include="Microsoft.VisualStudio.LiveShare.LanguageServices" Version="$(MicrosoftVisualStudioLiveShareLanguageServicesVersion)" />
</ItemGroup>
......
......@@ -10,8 +10,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Navigation
internal class CSharpLspNavigationBarItemService : RoslynNavigationBarItemService
{
[ImportingConstructor]
protected CSharpLspNavigationBarItemService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
protected CSharpLspNavigationBarItemService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......@@ -20,8 +20,8 @@ protected CSharpLspNavigationBarItemService(RoslynLSPClientServiceFactory roslyn
internal class VBLspNavigationBarItemService : RoslynNavigationBarItemService
{
[ImportingConstructor]
protected VBLspNavigationBarItemService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
protected VBLspNavigationBarItemService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......@@ -30,8 +30,8 @@ protected VBLspNavigationBarItemService(RoslynLSPClientServiceFactory roslynLSPC
internal class TypeScriptLspNavigationBarItemService : RoslynNavigationBarItemService
{
[ImportingConstructor]
protected TypeScriptLspNavigationBarItemService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
protected TypeScriptLspNavigationBarItemService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......
......@@ -20,11 +20,11 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.Navigation
{
internal class RoslynNavigationBarItemService : AbstractNavigationBarItemService
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
internal RoslynNavigationBarItemService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
internal RoslynNavigationBarItemService(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
}
public override async Task<IList<NavigationBarItem>> GetItemsAsync(Document document, CancellationToken cancellationToken)
......
......@@ -17,13 +17,13 @@ internal class RoslynRemoteProjectInfoProvider : IRemoteProjectInfoProvider
{
private const string SystemUriSchemeExternal = "vslsexternal";
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
//private readonly IVsRemoteWorkspaceManager _remoteWorkspaceManager;
[ImportingConstructor]
public RoslynRemoteProjectInfoProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)//, IVsRemoteWorkspaceManager remoteWorkspaceManager)
public RoslynRemoteProjectInfoProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)//, IVsRemoteWorkspaceManager remoteWorkspaceManager)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
//_remoteWorkspaceManager = remoteWorkspaceManager ?? throw new ArgumentNullException(nameof(remoteWorkspaceManager));
}
......
......@@ -10,8 +10,8 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare.References
internal class CSharpLspFindUsagesService : RoslynFindUsagesService
{
[ImportingConstructor]
public CSharpLspFindUsagesService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, RemoteLanguageServiceWorkspace remoteLanguageServiceWorkspace)
: base(roslynLSPClientServiceFactory, remoteLanguageServiceWorkspace)
public CSharpLspFindUsagesService(RoslynLSPClientServiceFactory roslynLspClientServiceFactory, RemoteLanguageServiceWorkspace remoteLanguageServiceWorkspace)
: base(roslynLspClientServiceFactory, remoteLanguageServiceWorkspace)
{
}
}
......@@ -20,8 +20,8 @@ public CSharpLspFindUsagesService(RoslynLSPClientServiceFactory roslynLSPClientS
internal class VBLspFindUsagesService : RoslynFindUsagesService
{
[ImportingConstructor]
public VBLspFindUsagesService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, RemoteLanguageServiceWorkspace remoteLanguageServiceWorkspace)
: base(roslynLSPClientServiceFactory, remoteLanguageServiceWorkspace)
public VBLspFindUsagesService(RoslynLSPClientServiceFactory roslynLspClientServiceFactory, RemoteLanguageServiceWorkspace remoteLanguageServiceWorkspace)
: base(roslynLspClientServiceFactory, remoteLanguageServiceWorkspace)
{
}
}
......
......@@ -18,9 +18,9 @@ internal class RoslynFindUsagesService : IFindUsagesService
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RemoteLanguageServiceWorkspace _remoteLanguageServiceWorkspace;
public RoslynFindUsagesService(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory, RemoteLanguageServiceWorkspace remoteLanguageServiceWorkspace)
public RoslynFindUsagesService(RoslynLSPClientServiceFactory roslynLspClientServiceFactory, RemoteLanguageServiceWorkspace remoteLanguageServiceWorkspace)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
_remoteLanguageServiceWorkspace = remoteLanguageServiceWorkspace ?? throw new ArgumentNullException(nameof(remoteLanguageServiceWorkspace));
}
......
......@@ -17,7 +17,7 @@ namespace Microsoft.CodeAnalysis.ExternalAccess.LiveShare
Role = ServiceRole.LocalService,
Features = "LspServices",
CreationPriority = (int)ServiceRole.LocalService + 2000)]
internal class RoslynLSPClientServiceFactory : ICollaborationServiceFactory
internal class RoslynLspClientServiceFactory : ICollaborationServiceFactory
{
private const string RoslynProviderName = "Roslyn";
private const string AnyProviderName = "any";
......
......@@ -11,8 +11,8 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client
internal class CSharpLspSignatureHelpProvider : RoslynSignatureHelpProvider
{
[ImportingConstructor]
public CSharpLspSignatureHelpProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public CSharpLspSignatureHelpProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......@@ -22,8 +22,8 @@ public CSharpLspSignatureHelpProvider(RoslynLSPClientServiceFactory roslynLSPCli
internal class VBLspSignatureHelpProvider : RoslynSignatureHelpProvider
{
[ImportingConstructor]
public VBLspSignatureHelpProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
: base(roslynLSPClientServiceFactory)
public VBLspSignatureHelpProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
: base(roslynLspClientServiceFactory)
{
}
}
......
......@@ -16,11 +16,11 @@ namespace Microsoft.VisualStudio.LanguageServices.LiveShare.Client
{
class RoslynSignatureHelpProvider : ISignatureHelpProvider
{
private readonly RoslynLSPClientServiceFactory _roslynLSPClientServiceFactory;
private readonly RoslynLspClientServiceFactory _roslynLSPClientServiceFactory;
public RoslynSignatureHelpProvider(RoslynLSPClientServiceFactory roslynLSPClientServiceFactory)
public RoslynSignatureHelpProvider(RoslynLspClientServiceFactory roslynLspClientServiceFactory)
{
_roslynLSPClientServiceFactory = roslynLSPClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLSPClientServiceFactory));
_roslynLSPClientServiceFactory = roslynLspClientServiceFactory ?? throw new ArgumentNullException(nameof(roslynLspClientServiceFactory));
}
public bool IsTriggerCharacter(char ch)
{
......
......@@ -9,7 +9,7 @@ internal class StringConstants
// The service name for an LSP server implemented using Roslyn designed to be used with the Roslyn client
public const string RoslynContractName = "Roslyn";
// 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 RoslynLspSdkContractName = "RoslynLSPSDK";
public const string CSharpLspLanguageName = "C#_LSP";
public const string CSharpLspContentTypeName = "C#_LSP";
......
......@@ -17,6 +17,7 @@
<ProjectReference Include="..\..\Core\Def\Microsoft.VisualStudio.LanguageServices.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Editor" Version="$(MicrosoftVisualStudioEditorVersion)" />
<PackageReference Include="Microsoft.VisualStudio.LiveShare.LanguageServices" Version="$(MicrosoftVisualStudioLiveShareLanguageServicesVersion)" />
</ItemGroup>
<ItemGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册