Skip to content

Commit

Permalink
Cohost code actions (#11147)
Browse files Browse the repository at this point in the history
Fixes #10742
Needs dotnet/roslyn#75711 before it will build
Also will need to merge in main once
#11141 is merged
  • Loading branch information
davidwengier authored Nov 7, 2024
2 parents 390aced + 31469c4 commit 40d2a6f
Show file tree
Hide file tree
Showing 59 changed files with 1,667 additions and 199 deletions.
76 changes: 38 additions & 38 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,82 +11,82 @@
<Sha>136e43e45e20bd58bf86eeabba0a0fa7e1a4b3ae</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-1.24522.7">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-2.24554.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>77c6704c42b162e89095631f12e2661398a75ba7</Sha>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
</ProductDependencies>
Expand Down
38 changes: 19 additions & 19 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@
<MicrosoftSourceBuildIntermediatearcadePackageVersion>9.0.0-beta.24516.2</MicrosoftSourceBuildIntermediatearcadePackageVersion>
<MicrosoftDotNetXliffTasksPackageVersion>1.0.0-beta.23475.1</MicrosoftDotNetXliffTasksPackageVersion>
<MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>1.0.0-beta.23475.1</MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>4.13.0-1.24522.7</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.13.0-1.24522.7</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.13.0-1.24522.7</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.13.0-1.24522.7</MicrosoftSourceBuildIntermediateroslynPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.13.0-1.24522.7</MicrosoftVisualStudioLanguageServicesPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>4.13.0-2.24554.8</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.13.0-2.24554.8</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.13.0-2.24554.8</MicrosoftSourceBuildIntermediateroslynPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.13.0-2.24554.8</MicrosoftVisualStudioLanguageServicesPackageVersion>
<!--
Exception - Microsoft.Extensions.ObjectPool and System.Collections.Immutable packages are not updated by automation,
but are present in Version.Details.xml for source-build PVP flow. See the comment in Version.Details.xml for more information.
Expand Down
1 change: 1 addition & 0 deletions eng/targets/Services.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<ServiceHubService Include="Microsoft.VisualStudio.Razor.Diagnostics" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteDiagnosticsService+Factory" />
<ServiceHubService Include="Microsoft.VisualStudio.Razor.Hover" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteHoverService+Factory" />
<ServiceHubService Include="Microsoft.VisualStudio.Razor.Completion" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteCompletionService+Factory" />
<ServiceHubService Include="Microsoft.VisualStudio.Razor.CodeActions" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteCodeActionsService+Factory" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
|
#if true
|
Generated Location: (986:28,2 [13] )
|
Generated Location: (986:28,2 [13] )
|
#if true
|

Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|
Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|
#endif
|
Generated Location: (1120:36,2 [11] )
|
Generated Location: (1120:36,2 [11] )
|
#endif
|

|
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
|
#if true
|
Generated Location: (733:21,0 [13] )
|
Generated Location: (733:21,0 [13] )
|
#if true
|

Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|
Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|
#endif
|
Generated Location: (877:30,0 [11] )
|
Generated Location: (877:30,0 [11] )
|
#endif
|

|
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
Keyword;[case];
Whitespace;[ ];
LeftBracket;[[];
CSharpOperator;[..];
Dot;[.];
Dot;[.];
Comma;[,];
Whitespace;[ ];
NumericLiteral;[3];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ public TextDocumentIdentifier GetTextDocumentIdentifier(VSCodeActionParams reque
_ => []
};

return await _codeActionsService.GetCodeActionsAsync(request, documentSnapshot, delegatedCodeActions, _supportsCodeActionResolve, cancellationToken).ConfigureAwait(false);
return await _codeActionsService.GetCodeActionsAsync(
request,
documentSnapshot,
delegatedCodeActions,
delegatedDocumentUri: null, // We don't use delegatedDocumentUri in the LSP server, as we can trivially recalculate it
_supportsCodeActionResolve,
cancellationToken).ConfigureAwait(false);
}

private async Task<RazorVSInternalCodeAction[]> GetHtmlCodeActionsAsync(IDocumentSnapshot documentSnapshot, VSCodeActionParams request, Guid correlationId, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,61 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.LanguageServer.Hosting;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Razor.CodeActions;
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.CodeAnalysis.Formatting;

namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions;

internal sealed class RoslynCodeActionHelpers(IClientConnection clientConnection) : IRoslynCodeActionHelpers
{
private static readonly Lazy<Workspace> s_workspace = new Lazy<Workspace>(() => new AdhocWorkspace());

private readonly IClientConnection _clientConnection = clientConnection;

public Task<string?> GetFormattedNewFileContentsAsync(string projectFilePath, Uri csharpFileUri, string newFileContent, CancellationToken cancellationToken)
public async Task<string> GetFormattedNewFileContentsAsync(IProjectSnapshot projectSnapshot, Uri csharpFileUri, string newFileContent, CancellationToken cancellationToken)
{
var parameters = new FormatNewFileParams()
{
Project = new TextDocumentIdentifier
{
Uri = new Uri(projectFilePath, UriKind.Absolute)
Uri = new Uri(projectSnapshot.FilePath, UriKind.Absolute)
},
Document = new TextDocumentIdentifier
{
Uri = csharpFileUri
},
Contents = newFileContent
};
return _clientConnection.SendRequestAsync<FormatNewFileParams, string?>(CustomMessageNames.RazorFormatNewFileEndpointName, parameters, cancellationToken);

var fixedContent = await _clientConnection.SendRequestAsync<FormatNewFileParams, string?>(CustomMessageNames.RazorFormatNewFileEndpointName, parameters, cancellationToken).ConfigureAwait(false);

if (fixedContent is not null)
{
return fixedContent;
}

// Sadly we can't use a "real" workspace here, because we don't have access. If we use our workspace, it wouldn't have the right settings
// for C# formatting, only Razor formatting, and we have no access to Roslyn's real workspace, since it could be in another process.
var node = await CSharpSyntaxTree.ParseText(newFileContent, cancellationToken: cancellationToken).GetRootAsync(cancellationToken).ConfigureAwait(false);
node = Formatter.Format(node, s_workspace.Value, cancellationToken: cancellationToken);

return node.ToFullString();
}

public Task<TextEdit[]?> GetSimplifiedTextEditsAsync(Uri codeBehindUri, TextEdit edit, bool requiresVirtualDocument, CancellationToken cancellationToken)
public Task<TextEdit[]?> GetSimplifiedTextEditsAsync(DocumentContext documentContext, Uri? codeBehindUri, TextEdit edit, CancellationToken cancellationToken)
{
var tdi = codeBehindUri is null
? documentContext.GetTextDocumentIdentifierAndVersion()
: new TextDocumentIdentifierAndVersion(new TextDocumentIdentifier() { Uri = codeBehindUri }, 1);
var delegatedParams = new DelegatedSimplifyMethodParams(
new TextDocumentIdentifierAndVersion(new TextDocumentIdentifier() { Uri = codeBehindUri }, 1),
requiresVirtualDocument,
tdi,
RequiresVirtualDocument: codeBehindUri == null,
edit);

return _clientConnection.SendRequestAsync<DelegatedSimplifyMethodParams, TextEdit[]?>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ protected override ILspServices ConstructLspServices()
services.AddSemanticTokensServices(featureOptions);
services.AddDocumentManagementServices(featureOptions);
services.AddFormattingServices(featureOptions);
services.AddCodeActionsServices();
services.AddOptionsServices(_lspOptions);
services.AddTextDocumentServices(featureOptions);

Expand All @@ -138,6 +137,8 @@ protected override ILspServices ConstructLspServices()
// Diagnostics
services.AddDiagnosticServices();

services.AddCodeActionsServices();

// Completion
services.AddCompletionServices();

Expand Down
Loading

0 comments on commit 40d2a6f

Please sign in to comment.