Author Topic: Refs shows virtual function proto from all projects; Current Project selected  (Read 2167 times)

TKasparek

  • Senior Community Member
  • Posts: 241
  • Hero Points: 28
I have many replica projects within a Workspace. Each project tracks single changes within the project. In this project there are many instances of inheritance of a virtual class. If you get a ref or a inherited virtual function and have Look In: set to <Current Project> you still get the virtual prototype of a function of the implementation class from all projects in the Workspace.

For example: (set this up and duplicate for a couple projects in a Workspace)

PureVirtualClass.hpp
Code: [Select]
class Something {
   virtual void MyFunc() = 0;
}

ImplementedA.hpp ->extends/implements PureVirtualClass.hpp
Code: [Select]
class SomethingImplementedA : public Something {
   virtual void MyFunc();
}

ImplementedA.cpp
Code: [Select]
void SomethingImplementedA::MyFunc() {
   doSomething();
}

ImplementedB.hpp
Code: [Select]
class SomethingImplementedB : public Something {
   virtual void MyFunc();
}

ImplementedB.cpp
Code: [Select]
void SomethingImplementedB::MyFunc() {
   doSomething();
}

Depending on the symbol you select when you Ctrl-/ on any instantiated use of MyFunc(), you get all the prototypes from all projects associated with the symbol; instead of just within the <Current Project> as specified.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3529
  • Hero Points: 471
I could not reproduce this problem, but perhaps a special case is giving you confusing results.  When you hit Ctrl+/, the current file (and it's "associated" files (.cpp is associated with matching .hpp) are ALWAYS included in the list of referenced files, whether it is in your current project or not.    Likewise, the file in which the symbol is defined in and the file in which the symbol is declared in are included.  So, if your current project is "ImplementedB" and you are in "ImplementedB.cpp" when you hit Ctlr+/, you are going to see both in the list.  However, if there is an "ImplementedC", it should be screened out.  The current file needs to be included because it would be very confusing not to include the originating reference.

Another thing to keep in mind here is that as far as the References Tool Window cares, your "<Current Project>" is the actual project system current project, not the project containing whatever file you happen to have open at the time.

TKasparek

  • Senior Community Member
  • Posts: 241
  • Hero Points: 28
I figured this might be hard to explain.
  • Default config
  • Open the workspace I've attached
  • Make Project1 the active project
  • Retag each project individually (they are tagged at project level so you need to do each individually)
  • Dock the references window and set to Look In: <Current Project>
  • Ctrl-/ with the cursor at MyFunc in Project1:ImplementationA.cpp
reference lookup . Select the SomethingImplementedA::MyFunc() symbol. It will show a reference from Project2 or Project3 often, but inconstantly. If it looks correct the first time just repeat step 6.
I've reproduced this issue many times following these steps.
It probably feels more consistent to me because I use 10-20 projects in a workspace in this fashion and it could be compounded when that happens. In my other projects, it shows other project references every time.
« Last Edit: February 17, 2016, 05:16:12 pm by TKasparek »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3529
  • Hero Points: 471
Silly me, I assumed that files would have different names and different class names.

I can put in a tweak for this, so that we do not show references to associated files that are not in the same project when screening by <Current Project>.

The fix will be in the next version (revision 4) of the cumulative hot fix for 20.0.1.

Thanks for the complete example and instructions.
« Last Edit: February 19, 2016, 06:14:15 pm by Dennis »