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 161954 - [REGRESSION] Go To File couldn't find some resource files
Summary: [REGRESSION] Go To File couldn't find some resource files
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 8.0.1
Hardware: Sun All
: P2 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords: REGRESSION
: 161482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-04 10:01 UTC by Vladimir Voskresensky
Modified: 2014-10-22 14:04 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch that fixes tasklist and goto file indexing in C/C++ projects (7.58 KB, text/plain)
2009-04-09 20:51 UTC, Vitezslav Stejskal
Details
New patch with the sourcepath based on MakeSources (12.14 KB, text/plain)
2009-04-14 13:05 UTC, Vitezslav Stejskal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2009-04-04 10:01:50 UTC
I built IDE with fixed
http://www.netbeans.org/issues/show_bug.cgi?id=122639

Is everything OK with search patterns and searched folders?
I've opened cnd.editor and Go To File doesn't work for some resource files.

I.e. full name 
C-DefaultAbbrevs.xml
is not found, the same for *.xml pattern => some xmls are visible, but C-DefaultAbbrevs.xml not in list

before Go To File could find that file in C/C++ Editor
org/netbeans/modules/cnd/editor/resources
Comment 1 Vladimir Voskresensky 2009-04-04 10:16:27 UTC
another example
tried to look for test files and the same result:
- opened MultiParseHyperlinkTestCase in cnd.completion
- looked for used test file ("source.cpp")
- tried to open it using Go To File
=> can not find file.
Yesterday it worked fine 
Have to switch back to yesterday's build :-(
Comment 2 Vitezslav Stejskal 2009-04-06 16:23:30 UTC
I'm sorry, I found the problem. The indexing infrastructure only scans certain mime types (those that have some editor
support registered), but with FileIndexer, TaskIndexer and similar indexer that generally look at any file this needs to
be changed.
Comment 3 Vladimir Voskresensky 2009-04-06 16:32:16 UTC
Btw, I don't know if it is related, but in today's build C++ projects doesn't support Go To File at all.
(CND does not use Indexing API)
Comment 4 Vitezslav Stejskal 2009-04-07 09:24:52 UTC
"in today's build C++ projects doesn't support Go To File at all" - What does this mean exactly? Goto file dialog shows
nothing for C++ projects?
Comment 5 Vladimir Voskresensky 2009-04-07 10:01:31 UTC
In today's build:
- create C++ Sample -> Quote application
- Ctrl+Shift+O
=> type anything quote.cc or *, or something else 
=> result is always empty
Comment 6 Vitezslav Stejskal 2009-04-07 14:28:15 UTC
All files under a root are now scanned and passed to appropriate indexers. http://hg.netbeans.org/jet-main/rev/75a55594514c

There is still the problem with C/C++ projects, where goto-file does not work (ie. shows nothing). My current suspicion
is that C/C++ projects do not register any source roots in GlobalPathRegistry and therefore the indexing infrastructure
does not see any files from C/C++ projects. Vladimir can you confirm this?
Comment 7 Vladimir Voskresensky 2009-04-07 15:47:03 UTC
I don't know how to check GlobalPathRegistry (I do not support project system), but:
1) when C++ project is opened => Task List scans all it's source
2) MakeProject creates lookup and put new MakeSources(this, helper) into lookup
class MakeSources implements Sources => could you please, review org.netbeans.modules.cnd.makeproject.MakeSources? 
Comment 8 Vitezslav Stejskal 2009-04-07 17:06:32 UTC
#1 - Are you sure that this is still working in dev builds? Tasklist (at least that part of tasklist that scans files
for TODO, XXX, etc) now runs as part of indexing and I think none of these patterns will be recognized in files in C/C++
projects. It's the same problem as with goto-file.

#2 - That's ok. I assume that your implementation is correct and there has been no changes in regard to source groups
introduced by indexing.

The problem is that indexing does not use source groups, because in general it is not possible to get source groups from
a project unless you know its type. And for example know that you should be looking up MakeSources class in the
project's lookup.

All the other projects/language supports that I've come across so far had some concept of classpath built in. The
concept of classpath is useful even in languages that natively don't have anything like classpath. But they still have
folders with sources, folders or binaries (zip/jar/gem/etc) with libraries and so the classpath concept is useful for
them. These projects register their classpaths in GlobalPathRegistry, which makes the classpath's roots available for
indexing. This as I understand now is very different in C/C++ projects.
Comment 9 Vladimir Voskresensky 2009-04-07 18:56:40 UTC
#1 you are right. Now tasklist doesn't scan our projects as well :-(

#2 yes, C++ is different, but don't want to miss Go To File functionality :-) (will be reported as P1 regression against
CND, especially because other projects don't regress)
Please, give us the example how to register and what to register. Probably we can do it was well. Or create a patch to
our project system to work in the way suitable for your infrastructure.

Thanks,
Vladimir.
Comment 10 Quality Engineering 2009-04-09 19:35:44 UTC
Integrated into 'main-golden', will be available in build *200904091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/75a55594514c
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #161954: scan all files under a root no matter what mimetype they have
Comment 11 Vitezslav Stejskal 2009-04-09 20:50:28 UTC
Vladimir, I have a patch that registers C/C++ projects directory in GlobalPathRegistry and so makes all files in the
project available for indexing. Therefore tasklist scanning and goto-file works again in those projects. I'm going to
attach the diff here first. Could you or somebody from your team please have a look and confirm that it's ok to push the
changes? It fixes tasklist and file index in C/C++ projects so I'm sure that the the fix works as far as the indexing is
concerned, but I don't know much about C/C++ projects and don't want to mess around with things without letting you guys
know. Plus I'm not 100% sure that this is the only place (project) that you guys have. If not, we will have to do the
same for the other places as well.

Also, I know that you sent me an email and asked about how to integrate C/C++ projects with the indexing infrastructure.
I'm sorry for not being responsive, but I'm just overloaded with defects. And considering that we are almost at beta I
would rather leave this for the next release. I'm sorry and thanks.
Comment 12 Vitezslav Stejskal 2009-04-09 20:51:25 UTC
Created attachment 79852 [details]
Patch that fixes tasklist and goto file indexing in C/C++ projects
Comment 13 Vladimir Voskresensky 2009-04-10 14:22:20 UTC
Vita, I'm cc Thomas to review your changes, but what I can see now:
1) Where does module org.netbeans.api.java.classpath comes from? Cnd cluster could not have dependency on Java cluster
2) You register only one folder - folder where "nbproject" is located, but we most of the time have projects with
existing sources and source folders are external.

Just a note: our source folders are correctly displayed in Files tab and they appear there because of
org.netbeans.modules.cnd.makeproject.MakeSources implementation placed into Project's lookup. May be it's more correct
to register source folder there?
Comment 14 Vitezslav Stejskal 2009-04-11 20:50:10 UTC
#1 - api.java.classpath module is in IDE cluster and so C/C++ can safely depend on it. Other languages that have their
own cluster/distro use it too (eg. php, ruby). It was originally part of java cluster, but was turned into a generic
classpath API long time ago and moved to the IDE cluster.

#2 - I see. I should probably tie the registration to MakeSources or do you have any other suggestion? Thanks
Comment 15 Vladimir Voskresensky 2009-04-12 22:19:34 UTC
re #1: great, so it's just a misleading code name containing java :-)
re #2: yes, I think it is better place

#3 I have tried today's fresh build and test file iz155578.cpp couldn't be found when cnd.completion module is opened :-(
Comment 16 Vitezslav Stejskal 2009-04-14 13:04:16 UTC
re #2 - I'm attaching a new patch, which creates sourcepath based on the contents of MakeSources
re #3 - That's because 'Unit Test Data' are not a source root and therefore not subject for indexing. This was mentioned
as a deficiency of the new design in issue #122639. Should this become too serious a problem we will have to fix it
somehow, but so far only a few people mildly complained, which is why we are tracking it as P3/defect (see issue #162580).

I'd like to integrate the patch before the beta clone is created, which is IMO on Wed 14th 2009. Obviously if there are
no objections.
Comment 17 Vitezslav Stejskal 2009-04-14 13:05:23 UTC
Created attachment 80039 [details]
New patch with the sourcepath based on MakeSources
Comment 18 Vladimir Voskresensky 2009-04-14 15:39:09 UTC
VV1: supported mime types are
"text/x-h", "text/x-c++", "text/x-c", "text/x-fortran", "text/x-make", "text/sh", "text/bat", "text/x-visu", "text/x-lex",
 "text/x-yacc", "text/x-asm", "text/qtui+xml", "text/qtresource+xml", "text/qttranslation+xml"

VV2: declare MutableCP as static class

otherwise I'm fine with patch.
Comment 19 Vladimir Voskresensky 2009-04-14 21:31:31 UTC
*** Issue 161482 has been marked as a duplicate of this issue. ***
Comment 20 Vitezslav Stejskal 2009-04-15 09:53:02 UTC
Thanks for the review. I tweaked the patch according to your suggestions and pushed it.
http://hg.netbeans.org/jet-main/rev/e96f6a51b1a3
Comment 21 Quality Engineering 2009-04-16 08:05:29 UTC
Integrated into 'main-golden', will be available in build *200904160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e96f6a51b1a3
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #161954 - fixing C/C++ projects to register their sources in GlobalPathRegistry and so make them visible for indexing
Comment 22 Vladimir Voskresensky 2009-04-16 12:00:51 UTC
Vita, thanks for the patch. Now Go To File works for C++ projects. But could you explain, why content of build and dist
folders are shown as well (executables and object files are visible now in Go To File) 
Comment 23 ggghhhjjj 2014-10-22 12:03:14 UTC
The "Go To File" can't fien some of the xml files in my java project.

I created one java project with exsiting sources. Then I tryed to find resourse  xml file by using "Go To File". The existing xml files in the project pakages were not found.

But when I use Edit->Find In Projects... the files had been found.

Product Version: NetBeans IDE 8.0.1 (Build 201408251540)
Updates: NetBeans IDE is updated to version NetBeans 8.0.1 Patch 1.1
Java: 1.7.0_55; Java HotSpot(TM) 64-Bit Server VM 24.55-b03
Runtime: Java(TM) SE Runtime Environment 1.7.0_55-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 24 Jiri Prox 2014-10-22 14:04:09 UTC
to ggghhhjjj:
can you please open a new issue for this, this one is very old. 
Also example of project project will be helpful. 
Thanks