This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156440 - "find usages" dialog is incomplete
Summary: "find usages" dialog is incomplete
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-07 18:53 UTC by tbrunhoff
Modified: 2012-10-06 19:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tbrunhoff 2009-01-07 18:53:55 UTC
Let's say I have a source tree located at ~/src/AB and beneath it are two different projects, A and B, located at
~/src/AB/A and ~/src/AB/B. These two projects share lots of source code. So I open the two projects A, then B, and using
the B project tree I navigate to, and open, the file ~/src/AB/common/file.cc which is used by both projects. Then I
right-click on a token in the file, and select "Find Usages". The dialog that pops up allows me to select from two Scopes:
  Open Projects
  project A

Note that I used project B to open the file yet it only offers project A as a specific scope (that's the first problem),
and project B is not offered as a scope, nor any other open project (that's the second problem).

Product Version: NetBeans IDE Dev (Build 200812180001)
Java: 1.7.0-ea; Java HotSpot(TM) 64-Bit Server VM 13.0-b01
System: Linux version 2.6.22.19 running on amd64; UTF-8; en_US (nb)
Userdir: /home/toddb/.netbeans/7.0m1
Comment 1 Vladimir Voskresensky 2009-04-07 14:01:07 UTC
In fact, we are consistent with other languages UI here :-(

"Open Projects" scope is the one you need to use
=> in this case Find Usages will process in both A and B.

When file is opened in editor it is not obvious where is it opened from (when file is shared by both projects)
I will check if it is possible to get information that file is sharable => in this case I will add all owner projects
into scope list.

Another approach for you could be:
- create Common project for ~/src/AB/common folder and specify that A and B depends on Common
=> file will belong to only one "Common" project
Comment 2 tbrunhoff 2009-04-07 16:57:47 UTC
> create Common project for ~/src/AB/common folder and specify that A and B depends on Common

I have often started to play with this. However, just as this bug is unclear about which project *in one tree* is being
searched, there is a similar problem that I described long ago in issue #145065. That is, the problem described above
becomes doubly complex.... now I have two different releases that contain projects A and B located in ~/src1/AB and
~/src2/AB.

The IDE refuses to identify src1/AB and src2/AB uniquely and simply presents two instances of project AB in the projects
pane. Which one is located in src1?? I have partly addressed this by checking in the projects with the name "AB", and
then making a local modification to AB/nbproject/project.xml to change <name>src1 AB</name>. This is ok for the number
of source tree instances I work on (~10).  But if I extend that practice to the number of subsystems in each source tree
(~30), I now have hundereds of locally modified xml files that I cannot check in.

In MSDEV, I deal with this by changing the name of the solution file (.sln) for each project and then opening each
project in a unique instance of MSDEV. I frequently have two or three of these open and my laptop works fine. However,
netbeans has a virtual memory size of 2GB and a resident set size of > 1GB. So multiple instances of netbeans doesn't
work here.
Comment 3 Quality Engineering 2009-04-08 19:59:24 UTC
Integrated into 'main-golden', will be available in build *200904081400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/24b0d2a71d68
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing IZ#156440: "find usages" dialog is incomplete
Comment 4 tbrunhoff 2009-05-19 17:01:38 UTC
In the initial description, above, I described two problems. You have nicely dealt with a related problem: getting the
ide to identify the source tree where each project resides. However, (and perhaps you known this), the two problems
described above still exist. I ran into the problem again today and decided to review the bug. The description is
accurate, and applies to:

Product Version: NetBeans IDE 6.7 Beta (Build 200904242137)
Java: 1.6.0_12; Java HotSpot(TM) 64-Bit Server VM 11.2-b01
System: Linux version 2.6.22.19 running on amd64; UTF-8; en_US (nb)
Userdir: /home/toddb/.netbeans/6.7beta
Comment 5 Vladimir Voskresensky 2009-09-25 14:06:21 UTC
consider for the next release due to lack of resources
Comment 6 Alexander Pepin 2010-10-27 14:17:04 UTC
It's not targeted to the current release.
Comment 7 tbrunhoff 2012-10-05 19:38:22 UTC
While I think there may remain some bugs here, my usage has changed and NB has changed. Vladimir's patch allowed me to see which source subtree is in use clarified lots of things. Either I no longer see the problems described here, or the way I use the IDE keeps me from seeing them.

So perhaps we should close this?
Comment 8 Vladimir Voskresensky 2012-10-06 19:40:11 UTC
Thanks. Let's close.