TheOne.Avalonia.CodeEditor 1.0.0-preview.2

This is a prerelease version of TheOne.Avalonia.CodeEditor.
dotnet add package TheOne.Avalonia.CodeEditor --version 1.0.0-preview.2
                    
NuGet\Install-Package TheOne.Avalonia.CodeEditor -Version 1.0.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TheOne.Avalonia.CodeEditor" Version="1.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TheOne.Avalonia.CodeEditor" Version="1.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="TheOne.Avalonia.CodeEditor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TheOne.Avalonia.CodeEditor --version 1.0.0-preview.2
                    
#r "nuget: TheOne.Avalonia.CodeEditor, 1.0.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TheOne.Avalonia.CodeEditor@1.0.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TheOne.Avalonia.CodeEditor&version=1.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TheOne.Avalonia.CodeEditor&version=1.0.0-preview.2&prerelease
                    
Install as a Cake Tool

TheOne.Avalonia.CodeEditor

独立的 .NET 10 / Avalonia 12.1.4 代码编辑器,不依赖 TheOne.Avalonia 主控件库。

安装与主题

dotnet add package TheOne.Avalonia.CodeEditor

在 App.axaml 中显式注册主题:

<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:one="using:TheOne.Avalonia.Themes">
  <Application.Styles>
    <one:CodeEditorTheme />
  </Application.Styles>
</Application>

主题包含本包色板、控件样式和 Fluent 原生控件基础样式,无需 OneTheme。与其他主题组合时,先注册本包主题,再注册宿主主题。

功能与使用

  • 自有虚拟化编辑内核,支持原生文本输入、IME、剪贴板和撤销重做。
  • 语法着色、查找、补全、行内建议、代码片段、参数提示、格式化和错误诊断。
  • 行内建议可通过 IsInlineCompletionEnabled 关闭;普通补全使用 Tab,代码片段保留 Tab-Tab 展开。
  • 单文件语义检查覆盖已知作用域内的未定义引用、基础类型赋值、函数参数及返回值;补全按可见绑定、遮蔽和已知预期类型排序,无需语言服务器。
  • C# 检查方法返回类型与参数声明缺失,参数提示优先匹配兼容重载;标题不改变 CodeType 指定的诊断语言。
  • 文本范围按真实布局片段绘制,支持双向文字、字素和软换行边界;独立语义着色层可通过 IsSemanticHighlightingEnabled 关闭。
  • 自有增量高亮借鉴 TextMate 作用域,支持嵌套插值、Markdown 围栏内语言及细分颜色;无需 TextMate 依赖,不导入外部语法文件。
  • 密度由 CodeEditor.Density 设置,使用 CodeEditorDensity.Small / Normal / Large;主题资源前缀为 CodeEditor.*。
  • 公共控件命名空间为 TheOne.Avalonia.Controls,仅保留 API 命名,不代表引用主控件库。

完整源码仓库包含中文和英文使用文档、独立 PreviewHost 及验证入口。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.2 55 10/16/2026

Standalone preview with incremental syntax scopes, nested interpolation, Markdown embedded highlighting, semantic colors and diagnostic range geometry. Known limitation: intermittent input/scroll performance long tails remain under investigation; single-file diagnostics do not replace a compiler.