Syntax Highlighting "modifiers"
-
Hello all,
I'm trying to setup Qt Creator for developing Zig code (i.e. the Zig programming language). As I understand it, the syntax highlighting information for Zig is provided by the KSyntaxHighlighting engine/project which is part of KDE. It works for the most part but two essential keywords 'const' and 'var' are not highlighted. Looking at the highlighting definition, they are listed as "modifiers".
See https://invent.kde.org/frameworks/syntax-highlighting/-/blob/4e5d1a962459d3f69dc617f00edac1be044267e1/data/syntax/zig.xml#L92So my question is: Is there a way to setup Qt Creator (Edit -> Preferences -> Text Editor -> Font & Colors) such that the listed "modifiers" are highlighted?
-
Hello all,
I'm trying to setup Qt Creator for developing Zig code (i.e. the Zig programming language). As I understand it, the syntax highlighting information for Zig is provided by the KSyntaxHighlighting engine/project which is part of KDE. It works for the most part but two essential keywords 'const' and 'var' are not highlighted. Looking at the highlighting definition, they are listed as "modifiers".
See https://invent.kde.org/frameworks/syntax-highlighting/-/blob/4e5d1a962459d3f69dc617f00edac1be044267e1/data/syntax/zig.xml#L92So my question is: Is there a way to setup Qt Creator (Edit -> Preferences -> Text Editor -> Font & Colors) such that the listed "modifiers" are highlighted?
@Gregg Qt Creator does fiddle a bit with the
KSyntaxHighlightinginformation. It is not 1 to 1. See TextEditor::categoryForTextStyle for details. -
I'm no expert in this. But, it looks like "modifiers" are mapped to "attributes". Maybe there is a suitable setting for attributes in Qt Creators.
-
@cristian-adam Thanks for the input. I've looked at the code of ksyntaxhighlighting, qt-creator and kate and and could not make much sense of it. Meaning I could not track down the place where "attributes" would be read or used from the zig.xml file.
After trying out more color schemes in QT Creator again it seems like "modifiers" are mapped to "locals", which apparently comes from KSyntaxHighlighting::Theme::Variable, but I don't yet see the connection in the source.
@SimonSchroeder Unfortunately that's not working for me. I'm on Qt Creator 17.0.1 and in the end it looks like "locals" is what I was looking for. Not sure how I missed that earlier and appreciate the input!
-
G Gregg has marked this topic as solved