TextEdit is a fully virtualized, extensible code editing control for Avalonia 11.3.x and .NET 8. It targets IDE-scale workloads, multi-gigabyte documents, and reuse of VS Code-class language intelligence while staying idiomatic to Avalonia.
- Overview
- Key Capabilities
- Architecture at a Glance
- Repository Layout
- Getting Started
- Testing & Quality
- Benchmarks
- Documentation
- Roadmap
- Contributing
- License
TextEdit provides the foundations for embedding a world-class code editor into Avalonia applications. The project combines a high-performance buffer model, GPU-accelerated rendering, and an extension-friendly architecture so host applications can deliver Visual Studio- or VS Code-class editing experiences without building an IDE from scratch.
- Fully virtualized rendering pipeline designed to keep UI threads free and hit 120+ FPS targets on large files.
- Piece-tree based document model enabling fast snapshotting, undo/redo journaling, and efficient diffing.
- Extensible language intelligence layer intended to host LSP clients, TextMate grammars, diagnostics, and semantic services.
- Plugin infrastructure spanning managed (.NET) and Node-based extensions to reuse VS Code ecosystem investments.
- Accessibility-aware input stack supporting multi-caret editing, column selections, IME composition, and assistive tooling.
- Observability hooks for telemetry, diagnostics, and performance instrumentation throughout the editor stack.
- Control Surface (
CodeEditorControl) orchestrates composition of rendering, input, and document services inside Avalonia. - Editor Kernel offers headless document operations, caret/selection management, command routing, and change notifications.
- Rendering Pipeline builds on Avalonia
TextLayout/TextShaperwith viewport-aware scheduling, glyph caching, minimap, and overlay adornments. - Language Intelligence layer targets LSP, TextMate, semantic tokens, diagnostics UI, and code actions via background workers.
- Extension Host plans for sandboxed managed and Node processes with a messaging bridge that mirrors VS Code extensibility.
- Service Fabric provides background job orchestration, caching, and telemetry to maintain responsiveness.
Detailed architectural goals, design milestones, and future work items live in
ARCHITECTURE.md.
src/— Core libraries (TextEdit.Core,TextEdit.Controls,TextEdit.Rendering,TextEdit.Extensions) targetingnet8.0.samples/TextEdit.Sandbox/— Minimal Avalonia host that wires up the editor control for manual exploration.tests/unit/— xUnit test projects covering core services and controls withcoverletinstrumentation.tests/benchmarks/— BenchmarkDotNet harnesses focused on buffer and rendering hot paths.docs/— Engineering handbook, onboarding checklist, and documentation templates.scripts/— Automation helpers, includingsetup-dev-env.shfor provisioning local environments.
- .NET 8 SDK (required)
- Node.js 18+ (recommended for developing the VS Code-compatible extension host)
- Git and supported build tools for your platform
Run scripts/setup-dev-env.sh to verify prerequisites, restore NuGet packages, and build the solution:
./scripts/setup-dev-env.shYou can manually build the solution from the repository root:
dotnet restore TextEdit.sln
dotnet build TextEdit.sln --configuration DebugLaunch the Avalonia sandbox to experiment with the editor surface:
dotnet run --project samples/TextEdit.Sandbox/TextEdit.Sandbox.csproj-
Run all unit tests:
dotnet test TextEdit.sln -
Coverage data is collected via the
coverlet.collectorpackage; configure collectors intests/unit/*/*.runsettings(if provided) or pass--collect:"XPlat Code Coverage"when invokingdotnet test. -
Continuous test and performance strategy is outlined in
docs/ENGINEERING-HANDBOOK.md.
Performance-critical routines use BenchmarkDotNet harnesses:
dotnet run --configuration Release --project tests/benchmarks/TextEdit.Benchmarks/TextEdit.Benchmarks.csprojReview results under tests/benchmarks/TextEdit.Benchmarks/bin/ to track regressions.
ARCHITECTURE.md— Full architecture specification, subsystem design, and milestone tracking.docs/ENGINEERING-HANDBOOK.md— Engineering practices, success metrics, and team roles.docs/ONBOARDING-CHECKLIST.md— Step-by-step onboarding guidance for new contributors.docs/templates/— Templates for specs, RFCs, and design reviews.
Development is organized into phased milestones captured in the architecture specification, covering:
- Rendering & virtualization hardening for large documents and high-DPI displays.
- Language intelligence enablement with LSP, TextMate, semantic tokens, and formatting hooks.
- Extension ecosystem work for managed and Node hosts plus marketplace packaging.
- Streaming, diff/merge, and collaboration scenarios built on the snapshot document graph.
- Quality & observability including instrumentation dashboards, watchdogs, and extensive automated testing.
Refer to the milestone tables in ARCHITECTURE.md for progress tracking and remaining work.
Contributions are welcome. Before opening a pull request:
- Align with the architectural direction documented in
ARCHITECTURE.md. - Run
./scripts/setup-dev-env.sh --verify-onlyand ensuredotnet testpasses. - Include relevant documentation updates in
docs/when introducing new subsystems or workflows. - Use issues to discuss large features or architectural changes ahead of implementation.
This project is licensed under the MIT License.