Inherits: SyntaxHighlighter < Resource < RefCounted < Object
A syntax highlighter intended for code.
By adjusting various properties of this resource, you can change the colors of strings, comments, numbers, and other text patterns inside a TextEdit control.
| ||
| ||
| ||
| ||
| ||
| ||
|
void | add_color_region ( String start_key, String end_key, Color color, bool line_only=false ) |
void | add_keyword_color ( String keyword, Color color ) |
void | add_member_keyword_color ( String member_keyword, Color color ) |
void | |
void | |
void | |
get_keyword_color ( String keyword ) const | |
get_member_keyword_color ( String member_keyword ) const | |
has_color_region ( String start_key ) const | |
has_keyword_color ( String keyword ) const | |
has_member_keyword_color ( String member_keyword ) const | |
void | remove_color_region ( String start_key ) |
void | remove_keyword_color ( String keyword ) |
void | remove_member_keyword_color ( String member_keyword ) |
{}
Sets the color regions. All existing regions will be removed. The Dictionary key is the region start and end key, separated by a space. The value is the region color.
Color(0, 0, 0, 1)
Sets color for functions. A function is a non-keyword string followed by a '('.
{}
Sets the keyword colors. All existing keywords will be removed. The Dictionary key is the keyword. The value is the keyword color.
{}
Sets the member keyword colors. All existing member keyword will be removed. The Dictionary key is the member keyword. The value is the member keyword color.
Color(0, 0, 0, 1)
Sets color for member variables. A member variable is non-keyword, non-function string proceeded with a '.'.
Color(0, 0, 0, 1)
Sets the color for numbers.
Color(0, 0, 0, 1)
Sets the color for symbols.
Adds a color region such as comments or strings.
Both the start and end keys must be symbols. Only the start key has to be unique.
line_only denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to true.
Sets the color for a keyword.
The keyword cannot contain any symbols except '_'.
Sets the color for a member keyword.
The member keyword cannot contain any symbols except '_'.
It will not be highlighted if preceded by a '.'.
Removes all color regions.
Removes all keywords.
Removes all member keywords.
Returns the color for a keyword.
Returns the color for a member keyword.
Returns true if the start key exists, else false.
Returns true if the keyword exists, else false.
Returns true if the member keyword exists, else false.
Removes the color region that uses that start key.
Removes the keyword.
Removes the member keyword.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_codehighlighter.html