Problems with parsing conditional compilation

Does Resharper support #if / #else / #endif parsing?


Parsing this don't works.

-


SNIPP----


using System;

namespace Foo
{
public abstract class FooBar
{
#if DEBUG
private int m_Foo = 0;

public int Foo
{
get { return m_Foo; }
}

public virtual void AssignFoo(int foo)
{
//do something
m_Foo = foo;
}

#else
//Speedup workaround, for non debug version
public int Foo = 0;

public virtual void AssignFoo(int foo)
{
//do something
Foo = foo;
}

#endif
}
}
-


SNIPP----



Result: http://www.postcardware.de/resharper.png



Carsten Jendro


1 comment
Comment actions Permalink

At present ReSharper assumes that all code is subject to compilation. It is
done to support the pattern

#if DEBUG
//log something
#endif

We are aware that this is not enough. We have a request in the tracker
(http://www.intellij.net/tracker/resharper/viewSCR?publicId=2449) to provide
options to support ignoring blocks inside conditional compilation (as is
your case).

--
Andrey Simanovsky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



"Carsten Jendro" <carsten.jendro@gmx.net> wrote in message
news:capttu$cvq$1@is.intellij.net...

Does Resharper support #if / #else / #endif parsing?

>
>

Parsing this don't works.

>

---------SNIPP--------------
using System;

>

namespace Foo
{
public abstract class FooBar
{
#if DEBUG
private int m_Foo = 0;

>

public int Foo
{
get { return m_Foo; }
}

>

public virtual void AssignFoo(int foo)
{
//do something
m_Foo = foo;
}

>

#else
//Speedup workaround, for non debug version
public int Foo = 0;

>

public virtual void AssignFoo(int foo)
{
//do something
Foo = foo;
}

>

#endif
}
}
---------SNIPP--------------

>

Result: http://www.postcardware.de/resharper.png

>
>
>

Carsten Jendro

>
>


0

Please sign in to leave a comment.