Hi Arnim,
You can post an issue on the repository if you like. I'll answer it either way (Greybeard == Eric Bishton), so this user group is also fine.
Putting '!macro' in the project definitions won't work. The NOT prefix ('!') is never recognized as a name; it is always an operator when parsing the code, so it can never match a definition in the definitions list.
Definitions in Haxe are defined as "true" by default. If you want to define them to something else (a string or any constant value), you can add ' =true|false|<float>|<int>|"string value" ' to the definition. So, just placing 'macro' in the definitions is the same as 'macro=true'.
The 'macro' definition behaves the same as any other definition. That is, code inside an "#if macro ... #end" block is mutually exclusive with "#if !macro ... #end". They are not both defined at the same time. That said, the *compiler* does two passes over the code, within a single compile run - setting the value differently during the macro pass. That is likely why you think of the definition of 'macro' differently than, say, a platform definition.
Currently, there is no way to pretend that any definition can be both set and unset -- or have multiple values. There is also no way to turn on or off the processing of definitions at the moment.
Now, as to solutions:
It may be possible to note that certain definitions are multiply defined. It certainly is possible to run the definition calculation multiple times -- but then, how to display that? Only highlight if all passes have a true result??
Another possibility is to ignore all conditionals and try to highlight the code as if the conditional statement wasn't there -- kind of like the pre-0.10.0 (plugin version) days. That had its own problems though -- not the least that the parser got confused easily if you didn't write your code just right (e.g. it had to be valid with all conditional sections present). It also causes issues with find, goto definition, refactoring, coloring, error detection, and on and on. This is why I spent a good deal of time restoring that functionality.
There are definitely improvements that can be made. I'd like to set up 'definition sets' that can be easily swapped between (sort of like the project file allows with '--next'). And I think it would be interesting to 'auto-swap' between definition sets just by placing your cursor into a block that you would like to see highlighted. (There are some other technical issues to be overcome for that to be feasible.) And I'm sure that other folks have their own ideas. I encourage everybody to add their desired features to the github repo (
https://github.com/HaxeFoundation/intellij-haxe/issues.
I'm sorry that the plugin doesn't have a way to do exactly what you want right now. Document the way you think it should work (in an issue) and we'll see what can be done about it. (BTW, there is already an issue about colorizing all sections as if the conditional compilation directives were not there -- feel free to add to it.)
-Eric