Syntax highlighting for conditional statements in VB not correct

i noticed , that conditional statements aren't handled correct.

2011-05-30 07h59_24.png

As you can see in the screenshot the code is grayed out although the project is in debug mode and "define DEBUG constant" is checked in the compile options (i didn't declare a DEBUG constant explicitely in the custom constants).

Regards
Klaus

P.S.: I'm working with Visual Studio 2008 and build 2155

2 comments

Hello Klaus,

I'm afraid I couldn't reproduce this behavior. Could you please attach a
small sample solution? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

i noticed , that conditional statements aren't handled correct.

Image:2011-05-30 07h59_24.png

As you can see in the screenshot the code is grayed out although the
project is in debug mode and "define DEBUG constant" is checked in the
compile options (i didn't declare a DEBUG constant explicitely in the
custom constants).

Regards
Klaus
P.S.: I'm working with Visual Studio 2008 and build 2155

---
Original message URL:
http://devnet.jetbrains.net/message/5304726#5304726



0

as i created the attached solution i could first also not reproduce the behavior. The #if was normally highlighted and the #else part was grayed out. I checked the advanced compile options and could see that the "define DBUG constant" was checked. Then i switched to release mode, checked the compile options and could see that "define DEBUG constant" was unchecked. Syntax highlighting didn't change so far, the #else part remains grayed out. Then i compiled my solution in release mode and could see that the syntax highlighting changes. Now the #if part was grayed out and the #else part was coloured. After this, no matter if i switch back to debug mode, compile, deleting R# cache, restarting Visual Studio...  the #if part remains grayed. Finally i stumbled over a subtle difference. When i code like C#:

#If DEBUG Then
...
#Else
...
#End If

syntax highlighting changes as expected, but if i code

#If Debug = True Then
...
#Else
...
#End If

i get the problems i mentioned. As both notations are valid in VB it would be nice if you can support them.

Regards
Klaus



Attachment(s):
ConditionalCompile.zip
0

Please sign in to leave a comment.