0

There is no longer highlighting in the text editor other than what I would qualify as the basic elements:

  • Double, int, float, const, etc.
  • "Strings", 'char'
  • for, while, if, etc.
  • Numbers, comments ...

This isn't an exhaustive list but you may get the point. However, beside some rare moments where everything is correctly highlighted, no keywords from other libraries are highlighted. In other words, the keywords (e.g. Mat, imread, etc.) from OpenCV, but also std, vector, etc. are not highlighted most of the time (but sometime yes).

All the autocomplete stuff works, though. Actually, everything worked fined until some unknown point...

Has it happened to anyone here? Maybe I blame Intellisense but it could be some hidden option I am not aware of...

I looked at the settings of the environment but everything is fine (there are colors assigned to the keywords...)

Doombot
  • 553
  • 3
  • 8
  • 18
  • http://stackoverflow.com/a/11003979/3294342 worked for half a second, then I lost the colour again – Doombot Nov 12 '14 at 14:57
  • 1
    If autocomplete works, then your project is configured properly. In my experience, Intellisense takes a while to "set in". Also, it doesn't highlight if your file isn't the main source. – a-Jays Nov 13 '14 at 07:36
  • OK! I am only using one source, though I am frequently changing it (a poor man's versioning). What do you mean by "set in"? Is it that you have to wait some seconds after typing or clicking to let it appear? – Doombot Nov 13 '14 at 13:44
  • What is strange is when I type a new variable declaration, say "string supah_dupah;" when I type the "_", the highlighting starts to work for a second then disappear... – Doombot Nov 13 '14 at 13:46
  • Like, right now, it works FOR NO REASON ARRRRRRRRGGG ;) – Doombot Nov 13 '14 at 19:05
  • 1
    The _ behaviour you mentioned is sort of what I meant by "set in". It is expected of all on-the-fly syntax assistants. They have to infer context from a statement that is continuously changing. I have noticed many times that it starts highlighting after I've moved on to 2-3 statements or so. Doesn't bother me anymore! – a-Jays Nov 14 '14 at 04:40
  • Ok I still suspect there is something murky with it (mainly because of its inconsistency: sometime it works so great!) but you convince me to learn to live with it. Thanks for your insights! :) – Doombot Nov 14 '14 at 13:45

1 Answers1

2

It works when there is no error and no warning in the code. So that pesky warning about the fact that implicitly casting a double to a float results into a loss of precision needs to be addressed (make it go!) in order to make it work...

I don't remember which page but there was I think such a warning on the Intellisense help page of the MSDN site...

Anyway, the bottom line is that, if your Intellisense seems to work (auto-completion, etc.) but fails at the syntactic coloration, a possible culprit is the presence of errors or warning in one of your files.

Doombot
  • 553
  • 3
  • 8
  • 18