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
Methods
AddColorRegion(string, string, Color, bool)
public void AddColorRegion(string startKey, string endKey, Color color, bool lineOnly = false)
Parameters
AddKeywordColor(string, Color)
public void AddKeywordColor(string keyword, Color color)
Parameters
keywordstringcolorColor
AddMemberKeywordColor(string, Color)
public void AddMemberKeywordColor(string keyword, Color color)
Parameters
keywordstringcolorColor
ClearColorRegions()
public void ClearColorRegions()
ClearKeywordColors()
public void ClearKeywordColors()
ClearMemberKeywordColors()
public void ClearMemberKeywordColors()
GetColorRegions()
public IReadOnlyList<CodeHighlightColorRegion> GetColorRegions()
Returns
GetFunctionColor()
public Color GetFunctionColor()
Returns
- Color
GetKeywordColor(string)
public Color GetKeywordColor(string keyword)
Parameters
keywordstring
Returns
- Color
GetKeywordColors()
public IReadOnlyDictionary<string, Color> GetKeywordColors()
Returns
- IReadOnlyDictionary<string, Color>
GetLineSyntaxHighlightingCore(int)
protected override IReadOnlyList<SyntaxHighlightSpan> GetLineSyntaxHighlightingCore(int line)
Parameters
lineint
Returns
GetMemberKeywordColor(string)
public Color GetMemberKeywordColor(string keyword)
Parameters
keywordstring
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
startKeystring
Returns
HasKeywordColor(string)
public bool HasKeywordColor(string keyword)
Parameters
keywordstring
Returns
HasMemberKeywordColor(string)
public bool HasMemberKeywordColor(string keyword)
Parameters
keywordstring
Returns
IsUIntSuffixEnabled()
public bool IsUIntSuffixEnabled()
Returns
OnClearHighlightingCache()
protected override void OnClearHighlightingCache()
OnInvalidateFromLine(int)
protected override void OnInvalidateFromLine(int line)
Parameters
lineint
RemoveColorRegion(string)
public void RemoveColorRegion(string startKey)
Parameters
startKeystring
RemoveKeywordColor(string)
public void RemoveKeywordColor(string keyword)
Parameters
keywordstring
RemoveMemberKeywordColor(string)
public void RemoveMemberKeywordColor(string keyword)
Parameters
keywordstring
SetColorRegions(IEnumerable<CodeHighlightColorRegion>)
public void SetColorRegions(IEnumerable<CodeHighlightColorRegion> regions)
Parameters
regionsIEnumerable<CodeHighlightColorRegion>
SetFunctionColor(Color)
public void SetFunctionColor(Color color)
Parameters
colorColor
SetKeywordColors(IDictionary<string, Color>)
public void SetKeywordColors(IDictionary<string, Color> colors)
Parameters
colorsIDictionary<string, Color>
SetMemberKeywordColors(IDictionary<string, Color>)
public void SetMemberKeywordColors(IDictionary<string, Color> colors)
Parameters
colorsIDictionary<string, Color>
SetMemberVariableColor(Color)
public void SetMemberVariableColor(Color color)
Parameters
colorColor
SetNumberColor(Color)
public void SetNumberColor(Color color)
Parameters
colorColor
SetSymbolColor(Color)
public void SetSymbolColor(Color color)
Parameters
colorColor
SetUIntSuffixEnabled(bool)
public void SetUIntSuffixEnabled(bool enabled)
Parameters
enabledbool