Skip to content

Commit 7efe8d7

Browse files
committed
Remove realistically unused method
1 parent 5b45de8 commit 7efe8d7

5 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/Razor/src/Microsoft.CodeAnalysis.Razor.CohostingShared/Completion/CohostDocumentCompletionEndpoint.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ public ImmutableArray<Registration> GetRegistrations(VSInternalClientCapabilitie
224224

225225
var rewrittenResponse = DelegatedCompletionHelper.RewriteHtmlResponse(result, razorCompletionOptions);
226226

227-
var razorDocumentIdentifier = new TextDocumentIdentifierAndVersion(completionParams.TextDocument, Version: 0);
228-
var resolutionContext = new DelegatedCompletionResolutionContext(razorDocumentIdentifier, RazorLanguageKind.Html, rewrittenResponse.Data ?? rewrittenResponse.ItemDefaults?.Data, ProvisionalTextEdit: null);
227+
var resolutionContext = new DelegatedCompletionResolutionContext(RazorLanguageKind.Html, rewrittenResponse.Data ?? rewrittenResponse.ItemDefaults?.Data, ProvisionalTextEdit: null);
229228
var resultId = _completionListCache.Add(rewrittenResponse, resolutionContext);
230229
rewrittenResponse.SetResultId(resultId, _clientCapabilitiesService.ClientCapabilities);
231230

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/ProjectSystem/DocumentContext.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Threading.Tasks;
88
using Microsoft.AspNetCore.Razor;
99
using Microsoft.AspNetCore.Razor.Language;
10-
using Microsoft.CodeAnalysis.Razor.Protocol;
1110
using Microsoft.CodeAnalysis.Text;
1211

1312
namespace Microsoft.CodeAnalysis.Razor.ProjectSystem;
@@ -26,9 +25,6 @@ public TextDocumentIdentifier GetTextDocumentIdentifier()
2625
DocumentUri = new(Uri),
2726
};
2827

29-
public TextDocumentIdentifierAndVersion GetTextDocumentIdentifierAndVersion()
30-
=> new(GetTextDocumentIdentifier(), Snapshot.Version);
31-
3228
private bool TryGetCodeDocument([NotNullWhen(true)] out RazorCodeDocument? codeDocument)
3329
{
3430
codeDocument = _codeDocument;

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/DelegatedTypes.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ internal record DelegatedMapCodeParams(
6969
[property: JsonPropertyName("focusLocations")] LspLocation[][] FocusLocations) : IDelegatedParams;
7070

7171
internal record DelegatedCompletionResolutionContext(
72-
[property: JsonPropertyName("identifier")] TextDocumentIdentifierAndVersion Identifier,
7372
[property: JsonPropertyName("projectedKind")] RazorLanguageKind ProjectedKind,
7473
[property: JsonPropertyName("originalCompletionListData")] object? OriginalCompletionListData,
7574
[property: JsonPropertyName("provisionalTextEdit")] TextEdit? ProvisionalTextEdit) : ICompletionResolveContext;

src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Completion/RemoteCompletionService.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ private async ValueTask<Response> GetCompletionAsync(
143143
documentSnapshot, positionInfo.ProvisionalTextEdit, cancellationToken).ConfigureAwait(false);
144144

145145
csharpCompletionList = await GetCSharpCompletionAsync(
146-
remoteDocumentContext.GetTextDocumentIdentifierAndVersion(),
147146
csharpGeneratedDocument,
148147
codeDocument,
149148
documentPositionInfo.HostDocumentIndex,
@@ -186,7 +185,6 @@ private async ValueTask<Response> GetCompletionAsync(
186185
}
187186

188187
private async ValueTask<RazorVSInternalCompletionList?> GetCSharpCompletionAsync(
189-
TextDocumentIdentifierAndVersion identifier,
190188
SourceGeneratedDocument generatedDocument,
191189
RazorCodeDocument codeDocument,
192190
int documentIndex,
@@ -240,7 +238,7 @@ private async ValueTask<Response> GetCompletionAsync(
240238
mappedPosition,
241239
razorCompletionOptions);
242240

243-
var resolutionContext = new DelegatedCompletionResolutionContext(identifier, RazorLanguageKind.CSharp, rewrittenResponse.Data ?? rewrittenResponse.ItemDefaults?.Data, provisionalTextEdit);
241+
var resolutionContext = new DelegatedCompletionResolutionContext(RazorLanguageKind.CSharp, rewrittenResponse.Data ?? rewrittenResponse.ItemDefaults?.Data, provisionalTextEdit);
244242
var resultId = _completionListCache.Add(rewrittenResponse, resolutionContext);
245243
rewrittenResponse.SetResultId(resultId, clientCapabilities);
246244

src/Razor/test/Microsoft.CodeAnalysis.Razor.CohostingShared.Test/Endpoints/CohostDocumentCompletionResolveEndpointTest.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ private async Task VerifyCompletionItemResolveAsync(TestCode input)
6060
new ThrowingSnippetCompletionItemResolveProvider(),
6161
LoggerFactory);
6262

63-
var textDocumentIdentifier = new TextDocumentIdentifierAndVersion(new TextDocumentIdentifier { DocumentUri = document.CreateDocumentUri() }, Version: 0);
64-
6563
var context = new DelegatedCompletionResolutionContext(
66-
textDocumentIdentifier,
6764
OriginalCompletionListData: null,
6865
ProjectedKind: RazorLanguageKind.Html,
6966
ProvisionalTextEdit: null);
@@ -88,7 +85,7 @@ private async Task VerifyCompletionItemResolveAsync(TestCode input)
8885

8986
var resultId = completionListCache.Add(list, context);
9087
list.SetResultId(resultId, clientCapabilities);
91-
RazorCompletionResolveData.Wrap(list, textDocumentIdentifier.TextDocumentIdentifier, clientCapabilities);
88+
RazorCompletionResolveData.Wrap(list, new TextDocumentIdentifier { DocumentUri = document.CreateDocumentUri() }, clientCapabilities);
9289

9390
var request = list.Items[0];
9491
// Simulate the LSP client, which would receive all of the items and the list data, and send the item back to us with

0 commit comments

Comments
 (0)