Skip to content

Commit 00b1ea3

Browse files
Rename method back to OnInitializedAsync
1 parent c9efa48 commit 00b1ea3

File tree

13 files changed

+28
-28
lines changed

13 files changed

+28
-28
lines changed

src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorLanguageServerBenchmarkBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ await projectManager.UpdateAsync(
8787

8888
private class NoopClientNotifierService : IClientConnection, IOnInitialized
8989
{
90-
public Task InitializeAsync(ILspServices services, CancellationToken cancellationToken)
90+
public Task OnInitializedAsync(ILspServices services, CancellationToken cancellationToken)
9191
{
9292
return Task.CompletedTask;
9393
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ClientConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public async Task SendNotificationAsync(string method, CancellationToken cancell
4848
/// <summary>
4949
/// Fires when the language server is set to "Started".
5050
/// </summary>
51-
public Task InitializeAsync(ILspServices services, CancellationToken cancellationToken)
51+
public Task OnInitializedAsync(ILspServices services, CancellationToken cancellationToken)
5252
{
5353
_initializedCompletionSource.TrySetResult(true);
5454
return Task.CompletedTask;

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/IOnInitialized.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer;
1010

1111
internal interface IOnInitialized
1212
{
13-
Task InitializeAsync(ILspServices services, CancellationToken cancellationToken);
13+
Task OnInitializedAsync(ILspServices services, CancellationToken cancellationToken);
1414
}

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/ProjectSystem/SnapshotResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public SnapshotResolver(IProjectSnapshotManager projectManager, ILoggerFactory l
3535
MiscellaneousHostProject = new HostProject(normalizedPath, normalizedPath, FallbackRazorConfiguration.Latest, rootNamespace: null, "Miscellaneous Files");
3636
}
3737

38-
public Task InitializeAsync(ILspServices services, CancellationToken cancellationToken)
38+
public Task OnInitializedAsync(ILspServices services, CancellationToken cancellationToken)
3939
{
4040
// This is called when the language server is initialized.
4141

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorConfigurationEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task HandleNotificationAsync(DidChangeConfigurationParams request,
2727
await _optionsMonitor.UpdateAsync(cancellationToken).ConfigureAwait(false);
2828
}
2929

30-
public async Task InitializeAsync(ILspServices services, CancellationToken cancellationToken)
30+
public async Task OnInitializedAsync(ILspServices services, CancellationToken cancellationToken)
3131
{
3232
var capabilitiesService = services.GetRequiredService<IClientCapabilitiesService>();
3333
var clientCapabilities = capabilitiesService.ClientCapabilities;

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorFileChangeDetectorManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal class RazorFileChangeDetectorManager(
2020
private readonly object _disposeLock = new();
2121
private bool _disposed;
2222

23-
public async Task InitializeAsync(ILspServices services, CancellationToken cancellationToken)
23+
public async Task OnInitializedAsync(ILspServices services, CancellationToken cancellationToken)
2424
{
2525
// Initialized request, this occurs once the server and client have agreed on what sort of features they both support. It only happens once.
2626

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorInitializedEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task HandleNotificationAsync(InitializedParams request, RazorReques
2222

2323
foreach (var onStartedItem in onStartedItems)
2424
{
25-
await onStartedItem.InitializeAsync(requestContext.LspServices, cancellationToken).ConfigureAwait(false);
25+
await onStartedItem.OnInitializedAsync(requestContext.LspServices, cancellationToken).ConfigureAwait(false);
2626
}
2727
}
2828
}

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DefaultRazorComponentSearchEngineTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected override async Task InitializeAsync()
4848
_projectManager = CreateProjectSnapshotManager();
4949

5050
var snapshotResolver = new SnapshotResolver(_projectManager, LoggerFactory);
51-
await snapshotResolver.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
51+
await snapshotResolver.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
5252
var documentVersionCache = new DocumentVersionCache(_projectManager);
5353

5454
var remoteTextLoaderFactoryMock = new StrictMock<RemoteTextLoaderFactory>();

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/DocumentPresentation/TextDocumentUriPresentationEndpointTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public async Task Handle_SimpleComponent_ReturnsResult()
3535
var projectManager = CreateProjectSnapshotManager();
3636

3737
var snapshotResolver = new SnapshotResolver(projectManager, LoggerFactory);
38-
await snapshotResolver.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
38+
await snapshotResolver.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
3939

4040
var project = await projectManager.UpdateAsync(updater => updater.CreateAndAddProject("c:/path/project.csproj"));
4141
await projectManager.CreateAndAddDocumentAsync(project, "c:/path/index.razor");
@@ -100,7 +100,7 @@ public async Task Handle_SimpleComponentWithChildFile_ReturnsResult()
100100
var projectManager = CreateProjectSnapshotManager();
101101

102102
var snapshotResolver = new SnapshotResolver(projectManager, LoggerFactory);
103-
await snapshotResolver.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
103+
await snapshotResolver.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
104104

105105
var project = await projectManager.UpdateAsync(updater => updater.CreateAndAddProject("c:/path/project.csproj"));
106106
await projectManager.CreateAndAddDocumentAsync(project, "c:/path/index.razor");
@@ -170,7 +170,7 @@ public async Task Handle_ComponentWithRequiredAttribute_ReturnsResult()
170170
var projectManager = CreateProjectSnapshotManager();
171171

172172
var snapshotResolver = new SnapshotResolver(projectManager, LoggerFactory);
173-
await snapshotResolver.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
173+
await snapshotResolver.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
174174

175175
var project = await projectManager.UpdateAsync(updater => updater.CreateAndAddProject("c:/path/project.csproj"));
176176
await projectManager.CreateAndAddDocumentAsync(project, "c:/path/index.razor");
@@ -402,7 +402,7 @@ public async Task Handle_ComponentWithNestedFiles_ReturnsResult()
402402
var projectManager = CreateProjectSnapshotManager();
403403

404404
var snapshotResolver = new SnapshotResolver(projectManager, LoggerFactory);
405-
await snapshotResolver.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
405+
await snapshotResolver.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
406406

407407
var project = await projectManager.UpdateAsync(updater => updater.CreateAndAddProject("c:/path/project.csproj"));
408408
await projectManager.CreateAndAddDocumentAsync(project, "c:/path/index.razor");

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorFileChangeDetectorManagerTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public async Task InitializedAsync_StartsFileChangeDetectors()
6060
using (var detectorManager = new RazorFileChangeDetectorManager(workspaceDirectoryPathResolver, [detectorMock1.Object, detectorMock2.Object]))
6161
{
6262
// Act
63-
await detectorManager.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
63+
await detectorManager.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
6464
}
6565

6666
// Assert
@@ -98,7 +98,7 @@ public async Task InitializedAsync_Disposed_ReStopsFileChangeDetectors()
9898
using var detectorManager = new RazorFileChangeDetectorManager(workspaceDirectoryPathResolver, [detectorMock.Object]);
9999

100100
// Act
101-
var initializeTask = detectorManager.InitializeAsync(StrictMock.Of<ILspServices>(), DisposalToken);
101+
var initializeTask = detectorManager.OnInitializedAsync(StrictMock.Of<ILspServices>(), DisposalToken);
102102
detectorManager.Dispose();
103103

104104
// Unblock the detector start

0 commit comments

Comments
 (0)