I need help with SyntaxHighlighter/CodeHighlighter

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cyber-Kun

when I click on my custom CodeHighlighter I can change a bunch of options in the inspector. for instance I can set Number Color, Symbol Color Function Color, and Keyword Colors.
now I have a bunch of keywords that will all be the same color. but going through and assigning the same color to 60 keywords is a bit tedious.
when I go to keyword Colors>new key/edit,in the inspector, I can select what seems like all the different data types, like dictionary or a packed string array or bool.
is there a way for me to make it so that all the keywords in the array have the same color?
without needing to script it all.

:bust_in_silhouette: Reply From: mcanton

It is not possible to do it from the inspector. You must do it from some script in the scene, or you directly create a script where you extend CodeHighlighter.

extends CodeHighlighter

const KEYWORD_COLOR := Color("#ff7085")
const KEYWORDS := ["and", "class", "func"]

func _init() -> void:
	for word in KEYWORDS:
		add_keyword_color(word, KEYWORD_COLOR)