Port Editor and ted settings to MEC (re-derived; supersedes #240)#264
Conversation
…ilder) Re-derives the MEC migration (supersedes the stale #240 / tig/mec-port) onto current develop. Engine (src/Terminal.Gui.Editor): - Add Configuration/EditorSettings.cs (POCO + static Defaults facade), EditorKeyBindingDefaults.cs (default binding table), and EditorConfiguration.cs (Apply(IConfiguration) reading the "Editor" section + a legacy section). - Editor.Commands.cs: drop [ConfigurationProperty(Scope=typeof(SettingsScope))]; DefaultKeyBindings now delegates to EditorSettings.Defaults. - Reference Microsoft.Extensions.Configuration.Abstractions. ted: - Add TerminalGuiConfigurationBootstrap (TuiConfigurationBuilder -> ApplyToStaticFacades + EditorConfiguration.Apply + EditorSettings.Apply). - Migrate EditorSettings to a POCO + MEC bind; Save() writes the MEC-native "EditorSettings": {...} shape and migrates away from legacy dotted / AppSettings keys. Legacy CM attributes kept under #pragma CS0618 as a transition shim. - Program.cs: replace ConfigurationManager.Enable with the bootstrap. Tests: port keybinding-config + ted-persistence suites to the MEC path. Validated against Terminal.Gui release/v2.4.14-beta.1 (2.5.0-beta.1, contains #5411): build + Tests (571) + IntegrationTests (353) + ConfigTests (1) all green. Gating: the engine package builds against the current pinned TG, but ted needs TuiConfigurationBuilder (#5411), not yet in a published TG package - so hosted CI stays red until TG publishes a #5411 build and Editor's TerminalGuiVersion pin advances to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f20766ac5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| internal static void Apply () | ||
| { | ||
| TuiConfigurationBuilder builder = new ("ted"); |
There was a problem hiding this comment.
Gate the TuiConfigurationBuilder call on the TG bump
When building ted with the repo's default TerminalGuiVersion pin (2.4.14-develop.2 in Directory.Build.props), this direct reference requires the new Terminal.Gui MEC API before the dependency has been bumped, so examples/ted and the solution fail to compile and the Program.cs comment's CM fallback can never run. Please either bump the Terminal.Gui pin in the same change or keep a real compatibility path, e.g. conditional/reflection fallback to ConfigurationManager, until the new API is available.
Useful? React with 👍 / 👎.
2.4.15 is the first published stable TG with the MEC API this branch targets. Builds + Tests (571) + IntegrationTests (353) + ConfigTests (1) all green against the published package. Unblocks this PR's CI and fixes develop's red TG-bump canary once merged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- TedConfigurationManagerTests.cs: move #pragma warning disable CS0618 above the using block (ReSharper whole-solution cleanup canonical order) — the local Stop-hook only cleans changed files, so this committed-file drift slipped past it; CI's whole-solution gate caught it. - Program.cs: correct the bootstrap comment — there is no ConfigurationManager fallback; the MEC path requires Terminal.Gui >= 2.4.15 (addresses Codex review). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Re: Codex P1 (gate the
So the API is available before the call site, and the comment no longer implies an unimplemented path. |
Summary
Ports Editor/ted configuration to Terminal.Gui's MEC path (
TuiConfigurationBuilder), off the now-[Obsolete]ConfigurationManagerAPI. Re-derived cleanly onto currentdevelopto supersede the stale #240 (tig/mec-port, ~71 commits behind).Aligns with TG's split migration plan:
TuiConfigurationBuilder)This PR is the #5411-phase migration; it is not waiting on #5416.
What changed
Engine (
src/Terminal.Gui.Editor)Configuration/EditorSettings.cs(settings POCO + staticDefaultsfacade),EditorKeyBindingDefaults.cs(default binding table),EditorConfiguration.cs(Apply(IConfiguration)reading theEditorsection + a legacy section).Editor.Commands.cs: drop[ConfigurationProperty(Scope=typeof(SettingsScope))];DefaultKeyBindingsdelegates toEditorSettings.Defaults.Microsoft.Extensions.Configuration.Abstractions.ted
TerminalGuiConfigurationBootstrap(TuiConfigurationBuilder→ApplyToStaticFacades+EditorConfiguration.Apply+EditorSettings.Apply).EditorSettings→ POCO + MEC bind;Save()writes the MEC-native"EditorSettings": {…}shape and migrates away from legacy dotted /AppSettingskeys. Legacy CM attributes retained under#pragma CS0618as a transition shim.Program.cs: replaceConfigurationManager.Enablewith the bootstrap.Tests: keybinding-config + ted-persistence suites ported to the MEC path;
Microsoft.Extensions.Configurationadded to the two test projects.Validation
Built + tested against Terminal.Gui
release/v2.4.14-beta.1(2.5.0-beta.1, contains #5411) via the local-enlistment switch:Tests571 ·IntegrationTests353 ·ConfigTests1 — all 0 failuresEditor CI builds against the published TG package line. The engine package builds against the current pinned TG, but ted requires
TuiConfigurationBuilder(#5411), which is not yet in any published TG package — so hosted checks fail with missing-type errors until TG publishes a #5411 build (e.g. 2.5.0-beta.1 to NuGet, or #5411 on TG develop + a develop prerelease) and Editor's<TerminalGuiVersion>pin advances to it. Merge in lockstep with that bump.Supersedes #240.
🤖 Generated with Claude Code