Improve &&
and &
syntax highlighting by altering StringName
highlighting
#11381
Labels
Milestone
&&
and &
syntax highlighting by altering StringName
highlighting
#11381
Describe the project you are working on
A game, with the main text editor being Godot.
Describe the problem or limitation you are having in your project
The
StringName
(and by proxy&&(and)
and&(bitwise and)
) syntax highlighting is a bit of a mess.\
), the first ampersand of&&
or&
are the color ofStringName
highlighting. This really irks me, it's the only reason I haven't used&&
overand
. As an anecdote, my first impression of seeing it in 4.x(videos online) is that godot was unprofessional and I couldn't understand why such a glaring flaw like that would hang around.StringName
, despite being parsed as&
or else borked. Due to my unfamiliarity, that quirk made me think you could space out the & if you wanted to. If the syntax highlighting changed, it would be much harder to confuse.&&
is the color ofStringName
(not pictured). Just strange and I don't know why it's there other than just 'cause. It goes back to symbol color after the 3rd.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Simplifying
StringName
highlighting would be the best, just make the ampersand symbol colored unless directly next to'
/"
(and not inside of another color block like strings). If there are arguments to the contrary, I would hear them out.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Link to my PR: godotengine/godot#100575
Here is the comparison. I think it's a more consistent coloration that most wouldn't notice, but advanced GDScript users should enjoy. As in, bitwise and using
&&
is on the rarer side, especially for newcomers.If this enhancement will not be used often, can it be worked around with a few lines of script?
No, as far as I know this syntax highlighting is baked into the text editor. You could work around it by changing
StringName
color to match the symbol color, but now yourStringName
s look like symbols or vice versa. Not a good compromise.Is there a reason why this should be core and not an add-on in the asset library?
See above section.
The text was updated successfully, but these errors were encountered: