qt creator: issue with syntax highlighting
Hi, I've found some problem. There's no code highlighting under preprocessor definition, even if definition is true.
Definitions which are false are just grey.
How to correct that? Thanks.
Do you mean no highlighting when you put the define in comment ?
#define FOO /* <- in myproject.config file */
#ifdef FOO /* some code here */ // <- no highlighting #endif
//#ifdef FOO /* some code here */ // <- highlighting is OK #endif
I have a feeling that it probably somehow connected to my previous highlighting configurations.
Also if #define FOO is located in source file everything is fine, but I'm using it as a global definition, so I put it in myproject.config file.
Indeed, at some point, if Qt Creator can't determine that FOO is defined, it can't do the highlighting as you would like.
@SGaist The problem that it's determining that FOO is defined, otherwise he would show all text inside definition as grey (or cut out), issue is happening if definition is defined in myproject.config file. Probably it just a bug and nothing can be done here.
Just to be sure I understand you correctly: you only have FOO defined in your myproject.config file but Qt Creator detects that and thus does the highlighting ?
@SGaist Yes, qt creator see definitions in myproject.config but for some reason it doesn't do a highlighting inside definitions condition.
#define FOO #ifdef FOO /* highlighting is OK here */ #endif
#ifdef FOO /* highlighting is NOT OK here, but it is active otherwise code would be grey */ #endif
//#define FOO /*<- definition is removed in config file*/
#ifdef FOO /* code is totally grey and cut, because QtCreator doesn't see FOO any more */ #endif
I'm really not sure Qt Creator's highlighting can take into account a define that come from an outside file like that one.
@SGaist Oh well, this is the whole sense of myproject.config file
I do understand the idea. You should contact the Qt Creator devs to see if this use case is already supported. You can to that either through IRC or the Qt Creator mailing list