Skip to content

Fix CodeEditor search ownership and upgrade AvalonEdit - #371

Merged
tgjones merged 3 commits into
tgjones:masterfrom
kornman00:kornman00-m1-m2-pr-plan
Oct 14, 2026
Merged

tgjones merged 3 commits into
tgjones:masterfrom
kornman00:kornman00-m1-m2-pr-plan

Conversation

@kornman00

Copy link
Copy Markdown
Contributor

Summary

  • Make each CodeEditor own one AvalonEdit SearchPanel instead of installing
    additional panels during load and document changes.
  • Add dual-target characterization for the existing AvalonEdit 6.0.0 editor
    behavior and packaged public contracts.
  • Upgrade AvalonEdit to 6.3.1.120 while preserving the characterized behavior
    on net48 and net10.0-windows.

Review guide

The commits are intentionally separated:

  1. e773302 Own one CodeEditor search panel
    • fixes the duplicated search-handler ownership;
    • adds focused STA/WPF regression coverage.
  2. cfefb87 Characterize AvalonEdit 6.0.0 contracts
    • captures settings, highlighting, document replacement, and undo/redo
      behavior before the dependency change;
    • extends package validation to compile and run an external CodeEditor
      consumer;
    • keys compatibility restores by the complete package family so a
      same-version stale package cannot be reused.
  3. 28e1cb1 Upgrade AvalonEdit to 6.3.1.120
    • changes only the dependency version, selected package assets, and expected
      assembly identity.

The characterization remained green after the upgrade, so no compatibility-fix
commit was required.

SearchPanel ownership

SearchPanel.Install creates a new panel and input handler each time it is
called. CodeEditor previously called it from both Loaded and
DocumentChanged, allowing handlers and panels to accumulate.

The editor now installs one privately owned panel during construction.
AvalonEdit's panel already follows TextArea.DocumentChanged, so the same panel
continues to search the current document without Gemini reinstalling it.

The regression tests cover:

  • repeated load/unload cycles and document replacement;
  • one effective search handler and one visual panel;
  • Find, next/previous, close, case, whole-word, regex, and invalid-regex
    behavior;
  • old-document and owned-subscription lifetimes.

AvalonEdit package contract

The package-only compatibility host now consumes
Gemini.Modules.CodeEditor and compiles external implementations against the
public AvalonEdit types exposed by CodeEditor, ICodeEditorView, and
ILanguageDefinition.

Resolved assets after the upgrade:

  • net48: lib/net462/ICSharpCode.AvalonEdit.dll
  • net10.0-windows: lib/net8.0-windows7.0/ICSharpCode.AvalonEdit.dll

Both hosts load assembly version 6.3.1.120.

AvalonEdit is strong-named, and its assembly version changes from 6.0.0.0 to
6.3.1.120. Extensions that use the exposed AvalonEdit types must rebuild
against the updated package family. This change does not add binding redirects
or promise binary compatibility for assemblies already compiled against
AvalonEdit 6.0.0.

Validation

dotnet restore src\Gemini.sln --configfile src\NuGet.config
dotnet build src\Gemini.sln --configuration Release --no-restore
dotnet test --project src\Gemini.Tests\Gemini.Tests.csproj --configuration Release --framework net48 --no-build --no-restore
dotnet test --project src\Gemini.Tests\Gemini.Tests.csproj --configuration Release --framework net10.0-windows --no-build --no-restore
dotnet pack src\Gemini.sln --configuration Release --no-build --no-restore --output build\packages
.\eng\validate-artifacts.ps1

Results:

  • Release build: 0 warnings, 0 errors.
  • Tests: 143 passed on net48; 143 passed on net10.0-windows.
  • Eight primary packages and their symbol packages validated.
  • Exact framework-specific AvalonEdit assets validated.
  • Package-only external consumers passed on both retained targets.
  • Gemini.Demo smoke checks passed for supported C# editing, highlighting,
    search navigation/options, document switching, and editor close/reopen
    cycles on both targets.

Base and rollback

  • Based on tgjones/gemini@6994950fe49f4b7d344e673b2590441043730175.
  • The search ownership fix is independent of the dependency upgrade.
  • Reverting 28e1cb1 returns to the characterized AvalonEdit 6.0.0 contract
    without reverting the search ownership fix or its tests.
  • Package publication remains handled by the existing upstream workflow.

Keep one installed AvalonEdit SearchPanel across load cycles and document replacement, with dual-target coverage for handlers, search behavior, and owned subscription lifetimes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 168d94f2-8e49-4a66-8ad7-d7073f7fc3d6
Add dual-target editor behavior coverage, consume the packaged CodeEditor public vendor-type boundary, validate exact AvalonEdit assets, and key package-only restore caches by the complete package family.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 168d94f2-8e49-4a66-8ad7-d7073f7fc3d6
Move CodeEditor to AvalonEdit 6.3.1.120 and update the exact framework asset and assembly identity contract for the retained net48 and net10 targets.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 168d94f2-8e49-4a66-8ad7-d7073f7fc3d6
@tgjones
tgjones merged commit 6625f4f into tgjones:master Oct 14, 2026
2 checks passed
@kornman00
kornman00 deleted the kornman00-m1-m2-pr-plan branch October 14, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants