Skip to content

Commit e9b4c2a

Browse files
Further clean up and organization in ProjectSnapshotManager
1 parent bde6b0b commit e9b4c2a

File tree

3 files changed

+148
-93
lines changed

3 files changed

+148
-93
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ internal interface IProjectSnapshotManager
1414
event EventHandler<ProjectChangeEventArgs> PriorityChanged;
1515
event EventHandler<ProjectChangeEventArgs> Changed;
1616

17+
bool IsSolutionClosing { get; }
18+
1719
ImmutableArray<ProjectKey> GetAllProjectKeys(string projectFileName);
1820
ImmutableArray<IProjectSnapshot> GetProjects();
1921
IProjectSnapshot GetLoadedProject(ProjectKey projectKey);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT license. See License.txt in the project root for license information.
3+
4+
namespace Microsoft.CodeAnalysis.Razor.ProjectSystem;
5+
6+
internal partial class ProjectSnapshotManager
7+
{
8+
private sealed record Entry(ProjectState State)
9+
{
10+
private IProjectSnapshot? _snapshotUnsafe;
11+
12+
public IProjectSnapshot GetSnapshot()
13+
{
14+
return _snapshotUnsafe ??= new ProjectSnapshot(State);
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)