Skip to content

Commit f1846a1

Browse files
committed
Fixes after merge
1 parent dcf8aa4 commit f1846a1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private void AddDocumentToMiscProjectCore(ProjectSnapshotManager.Updater updater
5050
var textDocumentPath = FilePathNormalizer.Normalize(filePath);
5151

5252
_logger.LogDebug($"Adding {filePath} to the miscellaneous files project, because we don't have project info (yet?)");
53-
var miscFilesProject = await _snapshotResolver.GetMiscellaneousProjectAsync(cancellationToken).ConfigureAwait(false);
53+
var miscFilesProject = _snapshotResolver.GetMiscellaneousProject();
5454

5555
if (miscFilesProject.GetDocument(FilePathNormalizer.Normalize(textDocumentPath)) is not null)
5656
{
@@ -67,13 +67,13 @@ private void AddDocumentToMiscProjectCore(ProjectSnapshotManager.Updater updater
6767

6868
_logger.LogInformation($"Adding document '{filePath}' to project '{miscFilesProject.Key}'.");
6969

70-
updater.DocumentAdded(projectSnapshot.Key, hostDocument, textLoader);
70+
updater.DocumentAdded(miscFilesProject.Key, hostDocument, textLoader);
7171

7272
// Adding a document to a project could also happen because a target was added to a project, or we're moving a document
7373
// from Misc Project to a real one, and means the newly added document could actually already be open.
7474
// If it is, we need to make sure we start generating it so we're ready to handle requests that could start coming in.
7575
if (_projectManager.IsDocumentOpen(textDocumentPath) &&
76-
_projectManager.TryGetLoadedProject(projectSnapshot.Key, out var project) &&
76+
_projectManager.TryGetLoadedProject(miscFilesProject.Key, out var project) &&
7777
project.GetDocument(textDocumentPath) is { } document)
7878
{
7979
document.GetGeneratedOutputAsync().Forget();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class RazorProjectServiceTest(ITestOutputHelper testOutput) : LanguageSer
3434
private TestProjectSnapshotManager _projectManager;
3535
private SnapshotResolver _snapshotResolver;
3636
private DocumentVersionCache _documentVersionCache;
37-
private RazorProjectService _projectService;
37+
private TestRazorProjectService _projectService;
3838
#nullable enable
3939

4040
protected override async Task InitializeAsync()
@@ -202,7 +202,7 @@ public async Task UpdateProject_MovesDocumentsFromMisc_ViaService()
202202

203203
await _projectService.AddDocumentToMiscProjectAsync(DocumentFilePath, DisposalToken);
204204

205-
var miscProject = await _snapshotResolver.GetMiscellaneousProjectAsync(DisposalToken);
205+
var miscProject = _snapshotResolver.GetMiscellaneousProject();
206206

207207
var project = _projectManager.GetLoadedProject(ownerProjectKey);
208208

@@ -657,7 +657,7 @@ public async Task OpenDocument_OpensAndAddsDocumentToMiscellaneousProject()
657657
var ownerProjectKey = await _projectService.AddProjectAsync(
658658
ProjectFilePath, IntermediateOutputPath, RazorConfiguration.Default, RootNamespace, displayName: null, DisposalToken);
659659

660-
var miscProject = await _snapshotResolver.GetMiscellaneousProjectAsync(DisposalToken);
660+
var miscProject = _snapshotResolver.GetMiscellaneousProject();
661661

662662
using var listener = _projectManager.ListenToNotifications();
663663

0 commit comments

Comments
 (0)