use vs persistence

This commit is contained in:
Matt Parker
2025-07-31 22:28:29 +10:00
parent 934d892113
commit 7008258e6a
7 changed files with 153 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
@using Ardalis.GuardClauses
@using Microsoft.Build.Construction
@using SharpIDE.Application.Features.SolutionDiscovery
@using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence
@if (_solutionFile is null)
{
@@ -19,6 +20,9 @@
[Parameter, EditorRequired]
public string SolutionFilePath { get; set; } = null!;
[Parameter, EditorRequired]
public SharpIdeSolutionModel SolutionModel { get; set; } = null!;
private SolutionFile _solutionFile = null!;
private List<ProjectInSolution> _rootNodes = [];
private Dictionary<string, Folder?> _folders = new();

View File

@@ -1,4 +1,6 @@
@using SharpIDE.Application.Features.Build
@using SharpIDE.Application.Features.SolutionDiscovery
@using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence
@inherits LayoutComponentBase
@inject IDialogService DialogService
@@ -11,7 +13,7 @@
<MudDrawer @bind-Open="@_drawerOpen" Width="400px" ClipMode="DrawerClipMode.Always">
@if (_solutionFilePath is not null)
{
<SolutionExplorer SolutionFilePath="@_solutionFilePath"/>
<SolutionExplorer SolutionModel="@_solutionModel" SolutionFilePath="@_solutionFilePath"/>
}
@* <NavMenu/> *@
</MudDrawer>
@@ -35,6 +37,7 @@
}
private string? _solutionFilePath;
private SharpIdeSolutionModel? _solutionModel;
protected override async Task OnInitializedAsync()
{
@@ -46,5 +49,7 @@
_solutionFilePath = solutionFilePath;
await BuildService.BuildSolutionAsync(_solutionFilePath);
var solutionModel = await RoslynTest.Analyse(_solutionFilePath);
_solutionModel = solutionModel;
}
}

View File

@@ -5,7 +5,8 @@
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development"
"DOTNET_ENVIRONMENT": "Development",
"MSBUILD_PARSE_SLN_WITH_SOLUTIONPERSISTENCE" : "true"
}
},
"(Watch)": {
@@ -15,7 +16,8 @@
"commandLineArgs": "watch run",
"environmentVariables": {
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_WATCH_RESTART_ON_RUDE_EDIT": "true"
"DOTNET_WATCH_RESTART_ON_RUDE_EDIT": "true",
"MSBUILD_PARSE_SLN_WITH_SOLUTIONPERSISTENCE" : "true"
}
}
}