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.
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
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 :-(
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.
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)
"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?
In today's build: - create C++ Sample -> Quote application - Ctrl+Shift+O => type anything quote.cc or *, or something else => result is always empty
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?
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?
#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.
#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.
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
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.
Created attachment 79852 [details] Patch that fixes tasklist and goto file indexing in C/C++ projects
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?
#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
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 :-(
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.
Created attachment 80039 [details] New patch with the sourcepath based on MakeSources
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.
*** Issue 161482 has been marked as a duplicate of this issue. ***
Thanks for the review. I tweaked the patch according to your suggestions and pushed it. http://hg.netbeans.org/jet-main/rev/e96f6a51b1a3
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
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)
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)
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