In Godot, you can create a class which inherits from the EditorSyntaxHighlighter class and specify your own highlighting in the built-in code editor. The highlighting output should be supported in Rider as well.
Whether this is something that needs work here or in the Godot engine itself to get working, I don't know. I will make an issue in the Godot repository if this is not the right place for it.