diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d047ae1..e6e65aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-dotnet@v5 with: - dotnet-version: '10.0.x' + global-json-file: global.json - name: Build run: dotnet build TuiCode.slnx --configuration Release @@ -80,7 +80,7 @@ jobs: - uses: actions/setup-dotnet@v5 with: - dotnet-version: '10.0.x' + global-json-file: global.json - name: AOT publish # No trim or AOT warnings: each one is a runtime failure waiting for the code path that hits it. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fbae829..dee98ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: - uses: actions/setup-dotnet@v5 with: - dotnet-version: '10.0.x' + global-json-file: global.json - name: Publish shell: bash diff --git a/AGENTS.md b/AGENTS.md index 1a59f34..00fcf41 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,6 +12,8 @@ Per-feature catalogues ("what works today") don't go in the README — they belo ## Quick start +Install the .NET SDK 10.0.402 or a newer 10.0 SDK ([download](https://dotnet.microsoft.com/download/dotnet/10.0)). `global.json` refuses anything older, and .NET 11 SDKs: an older SDK's Native AOT compiler crashes on macOS when a Go program starts TuiCode ([dotnet/runtime#132581](https://github.com/dotnet/runtime/issues/132581)). CI installs the SDK `global.json` names. + ```bash dotnet build TuiCode.slnx dotnet run --project src/TuiCode # needs a real terminal diff --git a/global.json b/global.json new file mode 100644 index 0000000..6916a33 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "10.0.402", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} diff --git a/tests/TuiCode.Tests/UnsavedEditsHostTests.cs b/tests/TuiCode.Tests/UnsavedEditsHostTests.cs index da7ddb3..cc5bef9 100644 --- a/tests/TuiCode.Tests/UnsavedEditsHostTests.cs +++ b/tests/TuiCode.Tests/UnsavedEditsHostTests.cs @@ -87,21 +87,12 @@ await HostSteps.RunUntilQuit(host, workbench.UnsavedEdits!.Flush(); }, () => host.App.InjectKey(Key.Q.WithCtrl), - () => Confirm(workbench) is not null, - () => - { - if (Confirm(workbench)?.FocusedChoice == "Don't save") return true; - host.App.InjectKey(Key.Tab); - return false; - }, - () => host.App.InjectKey(Key.Enter)); + () => ConfirmDialogs.Of(workbench) is not null, + ConfirmDialogs.Choose(host, workbench, "Don't save")); Assert.Empty(_fs.Directory.GetFiles(Recovery)); } - private static ConfirmView? Confirm(Workbench.Workbench workbench) => - workbench.SubViews.OfType().SingleOrDefault(); - private Workbench.Workbench BuildWorkbench(RecoveryOwner owner) => new(new SidebarPart(new FileExplorerView()), new EditorPart(), new StatusBarPart(), _workspaces, recovery: new RecoveryStore(_fs, Recovery, owner, _ => false));