Table of Contents

Method Highlight

Namespace
Terminal.Gui.Drawing
Assembly
Terminal.Gui.dll

Highlight(string, string?)

Highlights a single line of code and returns styled segments.

public IReadOnlyList<StyledSegment> Highlight(string code, string? language)

Parameters

code string

The source code line to highlight.

language string

The language identifier from the fence (e.g. csharp), or null if not specified.

Returns

IReadOnlyList<StyledSegment>

A list of StyledSegment instances representing the highlighted tokens.