SweetLine 1.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SweetLine --version 1.1.0
NuGet\Install-Package SweetLine -Version 1.1.0
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="SweetLine" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SweetLine" Version="1.1.0" />
<PackageReference Include="SweetLine" />
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 SweetLine --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SweetLine, 1.1.0"
#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 SweetLine@1.1.0
#: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=SweetLine&version=1.1.0
#tool nuget:?package=SweetLine&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SweetLine for .NET (C# / WinForms)
SweetLine is a high-performance syntax highlighting engine for modern editors.
This package provides the C# wrapper over the SweetLine native core.
Features
- Full-text highlighting (
TextAnalyzer) - Incremental highlighting (
DocumentAnalyzer) - Scope/indent guide analysis
- Style-ID and inline-style output modes
Install
dotnet add package SweetLine
Quick Start
using SweetLine;
var config = new HighlightConfig(showIndex: true, inlineStyle: false);
using var engine = new HighlightEngine(config);
engine.RegisterStyleName("keyword", 1);
engine.RegisterStyleName("string", 2);
engine.CompileSyntaxFromFile("syntaxes/csharp.json");
using var document = new Document("file:///example.cs", "public class Demo {}");
using var analyzer = engine.LoadDocument(document);
if (analyzer != null)
{
DocumentHighlight highlight = analyzer.Analyze();
IndentGuideResult guides = analyzer.AnalyzeIndentGuides();
}
Incremental Highlighting
var changeRange = new TextRange(
new TextPosition(line: 2, column: 4),
new TextPosition(line: 2, column: 8));
DocumentHighlight updated = analyzer!.AnalyzeIncremental(changeRange, "modified");
DocumentHighlightSlice visible = analyzer.AnalyzeIncrementalInLineRange(
changeRange,
"modified",
new LineRange(startLine: 0, lineCount: 120));
Native Library
- This package currently bundles native library for:
win-x64 - Bundled file path inside package:
runtimes/win-x64/native/sweetline.dll
Native resolver search order in SweetLineNative:
SWEETLINE_LIB_PATH(file or directory)- App base / current directory candidates
- Runtime native folders and common build output folders
- System default loader
If needed, set explicit path:
$env:SWEETLINE_LIB_PATH = "C:\\path\\to\\native"
Requirements
- .NET 8.0+
- Windows x64 (for bundled native binary in current package)
Maintainer: Pack and Publish
- Build native library to:
cmake-build-release-visual-studio/bin/sweetline.dll
- Pack:
dotnet pack platform/CSharp/SweetLine/SweetLine.csproj -c Release -o artifacts/nuget /p:PackageVersion=0.1.0
- Push:
$env:NUGET_API_KEY = "<your-nuget-api-key>"
dotnet nuget push artifacts/nuget/SweetLine.0.1.0.nupkg --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
Links
- Repository: https://github.com/FinalScave/SweetLine
- Full docs: https://github.com/FinalScave/SweetLine/tree/main/docs
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.