SharpVision.SyntaxHighlighting
1.6.0-beta.3
See the version list below for details.
dotnet add package SharpVision.SyntaxHighlighting --version 1.6.0-beta.3
NuGet\Install-Package SharpVision.SyntaxHighlighting -Version 1.6.0-beta.3
<PackageReference Include="SharpVision.SyntaxHighlighting" Version="1.6.0-beta.3" />
<PackageVersion Include="SharpVision.SyntaxHighlighting" Version="1.6.0-beta.3" />
<PackageReference Include="SharpVision.SyntaxHighlighting" />
paket add SharpVision.SyntaxHighlighting --version 1.6.0-beta.3
#r "nuget: SharpVision.SyntaxHighlighting, 1.6.0-beta.3"
#:package SharpVision.SyntaxHighlighting@1.6.0-beta.3
#addin nuget:?package=SharpVision.SyntaxHighlighting&version=1.6.0-beta.3&prerelease
#tool nuget:?package=SharpVision.SyntaxHighlighting&version=1.6.0-beta.3&prerelease
SharpVision.SyntaxHighlighting
SharpVision.SyntaxHighlighting is the optional syntax-highlighted code display
for SharpVision. It is an independent
C# reimplementation of the Kate/KSyntaxHighlighting
context-switching highlighting engine against the public
KDE syntax-definition XML format,
verified line-for-line against the upstream C++ engine's own source rather than
against the format documentation alone.
var view = new CodeView
{
Language = "Rust",
Code = """
fn main() {
println!("Hello, SharpVision!");
}
""",
};
CodeView is read-only - there is no editing API at all - but its content is
fully selectable and copyable by mouse or keyboard, exactly like a terminal
pager:
var view = new CodeView { Code = "let x = 1;" };
view.SelectAll();
var clipboardText = view.CopySelection(); // a pure read; the host wires the real clipboard
Regions delimited by a language's beginRegion/endRegion rules (braces,
blocks, multi-line comments, and similar) can be collapsed:
var view = new CodeView { Code = "fn f() {\n g();\n}", Language = "Rust" };
var firstFoldableLine = Enumerable.Range(0, 3).First(line => view.IsFoldStart(line));
view.ToggleFold(firstFoldableLine);
Every token is colored purely by its Kate default-style role (dsKeyword,
dsString, dsComment, and so on) resolved against CodeViewStyle, the same
semantic-color-first theming every other SharpVision control uses - a syntax
definition's own optional literal color hints are never read, so a theme swap
restyles every language consistently. See docs/concepts/syntax-highlighting.md
in the main repository for the full architecture, and
docs/controls/display/code-view.md for the complete control reference.
Loading additional languages
The embedded SyntaxDefinitionCatalog.Default ships 160 permissively licensed
syntax definitions - see Attribution below for exactly which
ones and why. Any other KDE-format XML file, including one of the definitions
this package does not embed, can be loaded from an application's own files:
var external = SyntaxDefinitionCatalog.FromDirectory("/path/to/syntax/definitions");
var catalog = SyntaxDefinitionCatalog.Default.Overlay(external);
var view = new CodeView { Catalog = catalog, Language = "Python" };
This mirrors upstream Kate's own local-file pickup model for syntax definitions.
Overlay definitions replace exact-name built-ins and otherwise augment them, so
cross-definition references resolve across both sources. Any safely omitted
definition, context, or keyword list remains observable through
SyntaxGrammar.Diagnostics. Definitions must declare kateversion; SharpVision
accepts format versions through 6.22 and rejects newer definitions before adding
them to the catalog. The reader also rejects unknown root/highlighting content,
invalid singleton ordering, and duplicate singleton sections. Repeated options
inside the schema-permitted general section are accumulated in document order.
Catalog metadata preserves the KDE style and hidden attributes without
forcing lazy embedded definitions to be parsed.
Attribution
159 of the 160 embedded syntax-definition XML files under Resources/Syntax/
are copied byte-for-byte from
KDE/syntax-highlighting, each
one included only because its own declared license is unambiguously permissive
(MIT, BSD-3-Clause, CC0-1.0, Zlib, or an explicit Public Domain dedication). See
THIRD-PARTY-NOTICES.md for the complete per-file list grouped by license, and
extern/kde-syntax-highlighting/README.md
in the main repository for the full audit methodology, including why roughly 250
upstream definitions - among them C, Python, PHP, Lua, MATLAB, Objective-C,
Pascal, and JSON - are not redistributed by this package. Full license texts
ship in the package's licenses/ directory.
The 160th, csharp.xml (C#), is first-party SharpVision source code, not
third-party: upstream's own C# definition carries no stated license and cannot
be redistributed, so this one was written from scratch against the C# grammar
directly and is licensed under this repository's own root LICENSE, the same as
every other file in this project.
No C++ source code from KDE/syntax-highlighting is compiled into or
redistributed by this package; only the third-party data files identified above
are.
| Product | Versions 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. |
-
net10.0
- JetBrains.Annotations (>= 2026.2.0)
- PCRE.NET (>= 1.5.0)
- SharpVision (>= 1.6.0-beta.3)
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.6.0-beta.7 | 145 | 9/15/2026 |
| 1.6.0-beta.6 | 68 | 9/15/2026 |
| 1.6.0-beta.5 | 70 | 9/15/2026 |
| 1.6.0-beta.4 | 111 | 9/15/2026 |
| 1.6.0-beta.3 | 67 | 9/15/2026 |
| 1.6.0-beta.2 | 65 | 9/14/2026 |
| 1.6.0-beta.1 | 71 | 9/13/2026 |
| 1.5.0-beta.1 | 134 | 9/6/2026 |
| 1.4.0-beta.1 | 104 | 9/3/2026 |
| 1.3.0-beta.1 | 205 | 8/27/2026 |
| 1.2.0-beta.1 | 133 | 8/25/2026 |
SharpVision.SyntaxHighlighting 1.6.0-beta.3 prerelease: version-aligned with the other SharpVision packages; no functional changes since 1.6.0-beta.2, in which CodeView selection started to take part in the application-wide single text selection introduced in SharpVision 1.6.0-beta.2: selecting in a CodeView collapses ranges held by other owners and vice versa. Since 1.6.0-beta.1 CodeView derives from the core ScrollableCompositeControlBase and uses the shared ProjectionSurface, scroll-bridge, PropertyChanged, attachment, and glyph-resolution seams introduced in SharpVision 1.6.0-beta.1, replacing its own CodeViewContent and hand-rolled copies; no public behavior change.