Request: Rebuild cache command

Hi,

In version 1.5 I always had the problem of classes in referenced assemblies
that were unknown to Resharper. I used to fix this by restarting Studio so
Resharper would refresh its cache.
In version 2.0 the problem still arises and has gone worse. For example,
Resharper does not see an instance of DataAdapter which is declared in the
same class! (Note that this is in a partial class so that could be part of
the problem).

Although I know you guys try your best to fix all bugs, I think this kind of
issues will remain in some situations.
Because it is a tedious job to restart Studio a couple of times a day to
trigger Resharper to rebuild its cache, I would welcome a command to rebuild
the Resharper cache. This would really save me a lot of time.

Regards,

Patrick


5 comments
Comment actions Permalink

Hello Patrick,

could you please elaborate more on the problem you had in 1.5? Which classes
were not recognized? What is the structure of the solution where the problem
happened (projects, referenced assemblies etc)? Thank you in advance.

As for your suggestion, it's not really so simple to implement.
There may be two instances of ReSharper caches for a specific solution - one
on your disk, persisted during solution opening, and another is in-memory,
used when you're working in VS. If the persistent copy got corrupted somehow,
ReSharper normally shouldn't load it, but if it does, you may encounter odd
problems
like a lot of red code. Remedy is to remove the persistent copy. However, it
seems that the problem you're talking about is caused by corruption of in-memory
caches,
which is almost definitely witnesses a bug in ReSharper. In this case, the
remedy is to either
load the persistent copy or to rebuild caches (both persistent and in-memory)
from scratch. The
latter is what happens when you open a solution for the first time. So the
command 'Rebuild Cache'
would in fact mean re-opening the solution, and you won't save much time
as compared with
closing and re-opening the VS.


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

Hi,

In version 1.5 I always had the problem of classes in referenced
assemblies
that were unknown to Resharper. I used to fix this by restarting
Studio so
Resharper would refresh its cache.
In version 2.0 the problem still arises and has gone worse. For
example,
Resharper does not see an instance of DataAdapter which is declared in
the
same class! (Note that this is in a partial class so that could be
part of
the problem).
Although I know you guys try your best to fix all bugs, I think this
kind of
issues will remain in some situations.
Because it is a tedious job to restart Studio a couple of times a day
to
trigger Resharper to rebuild its cache, I would welcome a command to
rebuild
the Resharper cache. This would really save me a lot of time.
Regards,

Patrick



0
Comment actions Permalink

Hi Dmitry,

Please see my comments below.

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

Hello Patrick,

>

could you please elaborate more on the problem you had in 1.5? Which
classes
were not recognized? What is the structure of the solution where the
problem
happened (projects, referenced assemblies etc)? Thank you in advance.

>
All our projects in our solution are C# projects, except for one which is a
C++ With Managed Extensions project.
We use this project to share definitions between our new product and our
legacy product.
This C++ project includes a header file with definitions which are exposed
as managed classes and enumerations.
ReSharper recognizes these exposed types correctly, until we change
something in the header and rebuild. Then no type is recognized anymore.
After reopening the solution, ReSharper recognizes the types again.

As for your suggestion, it's not really so simple to implement. There may
be two instances of ReSharper caches for a specific solution - one on your
disk, persisted during solution opening, and another is in-memory,
used when you're working in VS. If the persistent copy got corrupted
somehow,
ReSharper normally shouldn't load it, but if it does, you may encounter
odd problems
like a lot of red code. Remedy is to remove the persistent copy. However,
it
seems that the problem you're talking about is caused by corruption of
in-memory caches,
which is almost definitely witnesses a bug in ReSharper. In this case, the
remedy is to either
load the persistent copy or to rebuild caches (both persistent and
in-memory) from scratch. The
latter is what happens when you open a solution for the first time. So the
command 'Rebuild Cache'
would in fact mean re-opening the solution, and you won't save much time
as compared with
closing and re-opening the VS.


I beg to differ. When a solution is opened, ReSharper is triggered to load
its cache and build its in-memory cache.
Our solution, which is about 20 projects big, takes a considerable amount of
load of which the ReSharper phase is only a fraction. Most time is consumed
by Source Control and Web Services.
Of course I don't know the internals of ReSharper (so I can not make any
assumptions of the complexity of this kind of addition), but clearly there
is some event when opening a solution that triggers ReSharper to do its
thing. So why not make a menu option that fires this event?
It would save a lot of time for me.


Regards,

Patrick


0
Comment actions Permalink

Hello Patrick,

ReSharper is not able to analyse Managed C++ projects, so it attempts to
load the output
assembly of such a project. After rebuild of a C++ project, it should reload
the updated output assembly.
That's how this should work, and I have no idea why this doesn't work for
you in 1.5. We should investigate
this issue further.

Returning to your proposal, I see now that it may make some sense. We could
add an action that triggers
ReSharper's internal solution reload as if the solution were re-opened by
the user. Could you please submit
a request for this to our tracker?

Thank you.

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

Hi Dmitry,

Please see my comments below.

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

>> Hello Patrick,
>>
>> could you please elaborate more on the problem you had in 1.5? Which
>> classes
>> were not recognized? What is the structure of the solution where the
>> problem
>> happened (projects, referenced assemblies etc)? Thank you in advance.

All our projects in our solution are C# projects, except for one which
is a
C++ With Managed Extensions project.
We use this project to share definitions between our new product and
our
legacy product.
This C++ project includes a header file with definitions which are
exposed
as managed classes and enumerations.
ReSharper recognizes these exposed types correctly, until we change
something in the header and rebuild. Then no type is recognized
anymore.
After reopening the solution, ReSharper recognizes the types again.

>> As for your suggestion, it's not really so simple to implement. There
>> may
>> be two instances of ReSharper caches for a specific solution - one on
>> your
>> disk, persisted during solution opening, and another is in-memory,
>> used when you're working in VS. If the persistent copy got corrupted
>> somehow,
>> ReSharper normally shouldn't load it, but if it does, you may
>> encounter
>> odd problems
>> like a lot of red code. Remedy is to remove the persistent copy.
>> However,
>> it
>> seems that the problem you're talking about is caused by corruption
>> of
>> in-memory caches,
>> which is almost definitely witnesses a bug in ReSharper. In this
>> case, the
>> remedy is to either
>> load the persistent copy or to rebuild caches (both persistent and
>> in-memory) from scratch. The
>> latter is what happens when you open a solution for the first time.
>> So the
>> command 'Rebuild Cache'
>> would in fact mean re-opening the solution, and you won't save much
>> time
>> as compared with
>> closing and re-opening the VS.

I beg to differ. When a solution is opened, ReSharper is triggered to
load
its cache and build its in-memory cache.
Our solution, which is about 20 projects big, takes a considerable
amount of
load of which the ReSharper phase is only a fraction. Most time is
consumed
by Source Control and Web Services.
Of course I don't know the internals of ReSharper (so I can not make
any
assumptions of the complexity of this kind of addition), but clearly
there
is some event when opening a solution that triggers ReSharper to do
its
thing. So why not make a menu option that fires this event?
It would save a lot of time for me.
Regards,

Patrick



0
Comment actions Permalink

I think I have a simular problem but with C# Projects. When I have a solution with several c# projects it doesn't update
the resharper cache, because the output of the c# projects is in bin\debug, but the references are not project file referenes, but are references to a folder called "Compiled" The dll's are copied with a postbuild event copy command to this folder, so the referenced dll's change but resharper doesn't recognize that, because it only knows about bin\debug folder.
The reason I do this is due some Visual studio .net Bugs. And because I often add new projects to my solution, without
changeing them to Project References. Because i only debug something, and afterwards I remove the Project out of the solution, because of startup speed of the project.

0
Comment actions Permalink

Hello Thomas,

if you mean that your assembly references point to the 'Compiled' folder,
then ReSharper should be able to keep track of changes to the assemblies
in that folder and reload them when they change. Or do you mean something
else?

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

I think I have a simular problem but with C# Projects. When I have a
solution with several c# projects it doesn't update

the resharper cache, because the output of the c# projects is in
bin\debug, but the references are not project file referenes, but are
references to a folder called "Compiled" The dll's are copied with a
postbuild event copy command to this folder, so the referenced dll's
change but resharper doesn't recognize that, because it only knows
about bin\debug folder.

The reason I do this is due some Visual studio .net Bugs. And because
I often add new projects to my solution, without

changeing them to Project References. Because i only debug something,
and afterwards I remove the Project out of the solution, because of
startup speed of the project.



0

Please sign in to leave a comment.