Problems with conditional compilation

Resharper still has problems when it comes to conditional compilation - for
example, doing this:

bool flag;

#if DEBUG
flag = true;
#endif

Ressults in a warning saying flag is never set regardless of the state of
the DEBUG flag - it also causes Redundant using statement warnings that
aren't redundant...

Dino


5 comments
Comment actions Permalink

Hello Dean,

currently this is a known problem that ReSharper does not handle changes
to conditional compilation constants -
you'll need to re-open the project for ReSharper to become aware of their
new values. However, after re-opening
the problem should disappear. Isn't it the case for you?

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Resharper still has problems when it comes to conditional compilation
- for example, doing this:

bool flag;

#if DEBUG
flag = true;
#endif
Ressults in a warning saying flag is never set regardless of the state
of the DEBUG flag - it also causes Redundant using statement warnings
that aren't redundant...

Dino



0
Comment actions Permalink

No - that's not the case. I just opened this project 30 seconds ago from a
fresh copy of VS.Net, and it's doing the same thing...

In this case, it is not a standard conditional compilation arguement - it is
one I have added manually if that makes a difference.

Dino

"Dmitry Shaporenkov" <dsha@jetbrains.com> wrote in message
news:c8a894d9759718c78b5363085c73@news.intellij.net...

Hello Dean,

>

currently this is a known problem that ReSharper does not handle changes
to conditional compilation constants -
you'll need to re-open the project for ReSharper to become aware of their
new values. However, after re-opening the problem should disappear. Isn't
it the case for you?

>

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> Resharper still has problems when it comes to conditional compilation
>> - for example, doing this:
>>
>> bool flag;
>>
>> #if DEBUG
>> flag = true;
>> #endif
>> Ressults in a warning saying flag is never set regardless of the state
>> of the DEBUG flag - it also causes Redundant using statement warnings
>> that aren't redundant...
>>
>> Dino
>>
>



0
Comment actions Permalink

Hello Dean,

I can't repeat the problem. It doesn't matter whether the conditional compilation
symbol in question
is a standard or a user-defined one, as long as it is mentioned in the 'Conditional
Compilation Constants'
box for the currently active project configuration. Please note that ReSharper
only takes into account the
symbols for the active project configuration (and, moreover, it is not currently
able to recognize change of
the active configuration - you'll need to re-open project for such a change
to take effect for ReSharper).
So are you sure that your DEBUG symbol is defined in the currently active
configuration? If yes, could you please
create a small project demonstrating the issue?


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

No - that's not the case. I just opened this project 30 seconds ago
from a fresh copy of VS.Net, and it's doing the same thing...

In this case, it is not a standard conditional compilation arguement -
it is one I have added manually if that makes a difference.

Dino

"Dmitry Shaporenkov" <dsha@jetbrains.com> wrote in message
news:c8a894d9759718c78b5363085c73@news.intellij.net...

>> Hello Dean,
>>
>> currently this is a known problem that ReSharper does not handle
>> changes
>> to conditional compilation constants -
>> you'll need to re-open the project for ReSharper to become aware of
>> their
>> new values. However, after re-opening the problem should disappear.
>> Isn't
>> it the case for you?
>> Regards,
>> Dmitry Shaporenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> Resharper still has problems when it comes to conditional
>>> compilation - for example, doing this:
>>>
>>> bool flag;
>>>
>>> #if DEBUG
>>> flag = true;
>>> #endif
>>> Ressults in a warning saying flag is never set regardless of the
>>> state
>>> of the DEBUG flag - it also causes Redundant using statement
>>> warnings
>>> that aren't redundant...
>>> Dino
>>>


0
Comment actions Permalink

Have you tried it with ! where something isn't defined?

Where I see problems, I have this:

#if !SDE
#endif

Where SDE is not defined for this project - I think that is probably the
issue.

Dino

"Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
news:c8a894d97625c8c78bf2dd5e5cc8@news.intellij.net...

Hello Dean,

>

I can't repeat the problem. It doesn't matter whether the conditional
compilation symbol in question
is a standard or a user-defined one, as long as it is mentioned in the
'Conditional Compilation Constants'
box for the currently active project configuration. Please note that
ReSharper only takes into account the
symbols for the active project configuration (and, moreover, it is not
currently able to recognize change of
the active configuration - you'll need to re-open project for such a
change to take effect for ReSharper). So are you sure that your DEBUG
symbol is defined in the currently active configuration? If yes, could you
please
create a small project demonstrating the issue?

>
>

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> No - that's not the case. I just opened this project 30 seconds ago
>> from a fresh copy of VS.Net, and it's doing the same thing...
>>
>> In this case, it is not a standard conditional compilation arguement -
>> it is one I have added manually if that makes a difference.
>>
>> Dino
>>
>> "Dmitry Shaporenkov" <dsha@jetbrains.com> wrote in message
>> news:c8a894d9759718c78b5363085c73@news.intellij.net...
>>
>>> Hello Dean,
>>>
>>> currently this is a known problem that ReSharper does not handle
>>> changes
>>> to conditional compilation constants -
>>> you'll need to re-open the project for ReSharper to become aware of
>>> their
>>> new values. However, after re-opening the problem should disappear.
>>> Isn't
>>> it the case for you?
>>> Regards,
>>> Dmitry Shaporenkov
>>> JetBrains, Inc
>>> http://www.jetbrains.com
>>> "Develop with pleasure!"
>>>> Resharper still has problems when it comes to conditional
>>>> compilation - for example, doing this:
>>>>
>>>> bool flag;
>>>>
>>>> #if DEBUG
>>>> flag = true;
>>>> #endif
>>>> Ressults in a warning saying flag is never set regardless of the
>>>> state
>>>> of the DEBUG flag - it also causes Redundant using statement
>>>> warnings
>>>> that aren't redundant...
>>>> Dino
>>>>
>



0
Comment actions Permalink

Hello Dean,

no I haven't try the negation... I'll try.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Have you tried it with ! where something isn't defined?

Where I see problems, I have this:

#if !SDE
#endif
Where SDE is not defined for this project - I think that is probably
the issue.

Dino

"Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
news:c8a894d97625c8c78bf2dd5e5cc8@news.intellij.net...

>> Hello Dean,
>>
>> I can't repeat the problem. It doesn't matter whether the conditional
>> compilation symbol in question
>> is a standard or a user-defined one, as long as it is mentioned in
>> the
>> 'Conditional Compilation Constants'
>> box for the currently active project configuration. Please note that
>> ReSharper only takes into account the
>> symbols for the active project configuration (and, moreover, it is
>> not
>> currently able to recognize change of
>> the active configuration - you'll need to re-open project for such a
>> change to take effect for ReSharper). So are you sure that your DEBUG
>> symbol is defined in the currently active configuration? If yes,
>> could you
>> please
>> create a small project demonstrating the issue?
>> Regards,
>> Dmitry Shaporenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> No - that's not the case. I just opened this project 30 seconds ago
>>> from a fresh copy of VS.Net, and it's doing the same thing...
>>>
>>> In this case, it is not a standard conditional compilation arguement
>>> - it is one I have added manually if that makes a difference.
>>>
>>> Dino
>>>
>>> "Dmitry Shaporenkov" <dsha@jetbrains.com> wrote in message
>>> news:c8a894d9759718c78b5363085c73@news.intellij.net...
>>>
>>>> Hello Dean,
>>>>
>>>> currently this is a known problem that ReSharper does not handle
>>>> changes
>>>> to conditional compilation constants -
>>>> you'll need to re-open the project for ReSharper to become aware of
>>>> their
>>>> new values. However, after re-opening the problem should disappear.
>>>> Isn't
>>>> it the case for you?
>>>> Regards,
>>>> Dmitry Shaporenkov
>>>> JetBrains, Inc
>>>> http://www.jetbrains.com
>>>> "Develop with pleasure!"
>>>>> Resharper still has problems when it comes to conditional
>>>>> compilation - for example, doing this:
>>>>>
>>>>> bool flag;
>>>>>
>>>>> #if DEBUG
>>>>> flag = true;
>>>>> #endif
>>>>> Ressults in a warning saying flag is never set regardless of the
>>>>> state
>>>>> of the DEBUG flag - it also causes Redundant using statement
>>>>> warnings
>>>>> that aren't redundant...
>>>>> Dino


0

Please sign in to leave a comment.