tomasr / viasfora

A Visual Studio Extension containing miscellaneous improvements to the editor.
Other
554 stars 89 forks source link

#macros are ignored in c++ files #258

Open joshinils opened 6 years ago

joshinils commented 6 years ago

wrongviasfora2wrongviasfora

I happened to use a macro to turn off a portion of code. The part that gets ignored by the compiler should also get ignored by the outlining and coloration. i was a bit confused by this until i figured out what was happening. This is only an issue if the part that is disabled has wrong syntax, though i guess then that should be displayed in there somehow.

I'm using Version 4.1.128

tomasr commented 6 years ago

Thanks, @joshinils. Yes, this is an issue, but one that unfortunately I have no easy way to work around.

Viasfora does strictly lexical analysis, and so doesn't even know macros exist. This is not an issue in C++ only, C# has the same issue.

Things sort of work reasonably OK as long as you don't have orphan braces in disabled sections, but if you do, then the analyzer will not work correctly.