Class CodeHighlighter

Namespace
Forma
Assembly
Forma.dll

Basic configurable code highlighter corresponding to Godot's CodeHighlighter. It supports word/member colors and one-line or paired multiline color regions.

public sealed class CodeHighlighter : SyntaxHighlighter
Inheritance
CodeHighlighter
Inherited Members

Constructors

CodeHighlighter()

public CodeHighlighter()

Properties

FunctionColor

public Color FunctionColor { get; set; }

Property Value

Color

MemberVariableColor

public Color MemberVariableColor { get; set; }

Property Value

Color

NumberColor

public Color NumberColor { get; set; }

Property Value

Color

SymbolColor

public Color SymbolColor { get; set; }

Property Value

Color

UIntSuffixEnabled

public bool UIntSuffixEnabled { get; set; }

Property Value

bool

Methods

AddColorRegion(string, string, Color, bool)

public void AddColorRegion(string startKey, string endKey, Color color, bool lineOnly = false)

Parameters

startKey string
endKey string
color Color
lineOnly bool

AddKeywordColor(string, Color)

public void AddKeywordColor(string keyword, Color color)

Parameters

keyword string
color Color

AddMemberKeywordColor(string, Color)

public void AddMemberKeywordColor(string keyword, Color color)

Parameters

keyword string
color Color

ClearColorRegions()

public void ClearColorRegions()

ClearKeywordColors()

public void ClearKeywordColors()

ClearMemberKeywordColors()

public void ClearMemberKeywordColors()

GetColorRegions()

public IReadOnlyList<CodeHighlightColorRegion> GetColorRegions()

Returns

IReadOnlyList<CodeHighlightColorRegion>

GetFunctionColor()

public Color GetFunctionColor()

Returns

Color

GetKeywordColor(string)

public Color GetKeywordColor(string keyword)

Parameters

keyword string

Returns

Color

GetKeywordColors()

public IReadOnlyDictionary<string, Color> GetKeywordColors()

Returns

IReadOnlyDictionary<string, Color>

GetLineSyntaxHighlightingCore(int)

protected override IReadOnlyList<SyntaxHighlightSpan> GetLineSyntaxHighlightingCore(int line)

Parameters

line int

Returns

IReadOnlyList<SyntaxHighlightSpan>

GetMemberKeywordColor(string)

public Color GetMemberKeywordColor(string keyword)

Parameters

keyword string

Returns

Color

GetMemberKeywordColors()

public IReadOnlyDictionary<string, Color> GetMemberKeywordColors()

Returns

IReadOnlyDictionary<string, Color>

GetMemberVariableColor()

public Color GetMemberVariableColor()

Returns

Color

GetNumberColor()

public Color GetNumberColor()

Returns

Color

GetSymbolColor()

public Color GetSymbolColor()

Returns

Color

HasColorRegion(string)

public bool HasColorRegion(string startKey)

Parameters

startKey string

Returns

bool

HasKeywordColor(string)

public bool HasKeywordColor(string keyword)

Parameters

keyword string

Returns

bool

HasMemberKeywordColor(string)

public bool HasMemberKeywordColor(string keyword)

Parameters

keyword string

Returns

bool

IsUIntSuffixEnabled()

public bool IsUIntSuffixEnabled()

Returns

bool

OnClearHighlightingCache()

protected override void OnClearHighlightingCache()

OnInvalidateFromLine(int)

protected override void OnInvalidateFromLine(int line)

Parameters

line int

RemoveColorRegion(string)

public void RemoveColorRegion(string startKey)

Parameters

startKey string

RemoveKeywordColor(string)

public void RemoveKeywordColor(string keyword)

Parameters

keyword string

RemoveMemberKeywordColor(string)

public void RemoveMemberKeywordColor(string keyword)

Parameters

keyword string

SetColorRegions(IEnumerable<CodeHighlightColorRegion>)

public void SetColorRegions(IEnumerable<CodeHighlightColorRegion> regions)

Parameters

regions IEnumerable<CodeHighlightColorRegion>

SetFunctionColor(Color)

public void SetFunctionColor(Color color)

Parameters

color Color

SetKeywordColors(IDictionary<string, Color>)

public void SetKeywordColors(IDictionary<string, Color> colors)

Parameters

colors IDictionary<string, Color>

SetMemberKeywordColors(IDictionary<string, Color>)

public void SetMemberKeywordColors(IDictionary<string, Color> colors)

Parameters

colors IDictionary<string, Color>

SetMemberVariableColor(Color)

public void SetMemberVariableColor(Color color)

Parameters

color Color

SetNumberColor(Color)

public void SetNumberColor(Color color)

Parameters

color Color

SetSymbolColor(Color)

public void SetSymbolColor(Color color)

Parameters

color Color

SetUIntSuffixEnabled(bool)

public void SetUIntSuffixEnabled(bool enabled)

Parameters

enabled bool