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.
After addding folder into global include path CC doens't work immediately. The project must be reopened, then it works.
Hi Tor and Tomasz, I'm adding you to CC because I think that the project (classpath) side is OK. Scenario: - be sure to have PHP project with PHP Global Include Path on its "classpath" opened (verify in project properties, category PHP Include Path) - IDE Options -> PHP -> add folder to PHP Global Include Path - all the events are processed/fired in org.netbeans.modules.php.project.classpath.support.ProjectClassPathImplementation, GSF asks for ProjectClassPathImplementation.getResources() (the new folder is there) - but in CC I don't see functions from the new directory - restart IDE => CC is correct Thanks for any feedback.
Tor? Tomasz? Any ideas?
After the discussion with Tomasz, it looks like a GSF issue. Please evaluate, thanks.
*** Issue 143126 has been marked as a duplicate of this issue. ***
*** Issue 144341 has been marked as a duplicate of this issue. ***
I know what the problem is now. Unfortunately, I don't know a risk free way to fix it. The problem is that each ClasspathInfo caches its set of ClassIndex instances. This is done for performance. What happens here is that the Classpath is updated with the new library added to the global classpath, and its gets indexed, but the -existing- classpath instances don't get updated. For new files/projects, the new classpath is seen, but for existing open files, the cached instance is used which is why the restart is required. I'm really afraid to touch this code, and it's not tested well by unit tests since it's all about integration of classpath/projects/event firing/dialogs/startup scanning, etc. There's a pretty simple workaround: Restarting the IDE. Adding a global include path probably isn't done very often, so this shouldn't be too inconvenient. However, it's NOT obvious that a restart is needed. So, a temporary "fix" of this problem is to add a warning message to the properties dialog which explains that a restart may be needed. I've done that - see attached screenshot. This was done in changeset a535e8acd089. This should make it obvious that after tweaking your path, you should restart the IDE if you want to see the classpath reflected in code completion etc. This is not ideal, but I think it's the best choice for 6.5 given the risk of touching anything in the classpath area. After integrating this fix I'm downgrading this to a P3 for the remaining issue that this should be handled automatically rather than requiring user intervention.
Created attachment 71617 [details] New PHP include path dialog as of changeset a535e8acd089
By the way, there seems to be a bug in the PHP Include Path customizer. I had added a global include path there. After restarting the IDE etc. everything worked. When I expand the Libraries node in the project explorer, I see my library. However, when I open the dialog, it's not listed in the list! (See the screenshot - it's empty, even though I have a library).
> By the way, there seems to be a bug in the PHP Include Path customizer. Tor, could you please file a new issue against PHP project with steps to reproduce? Thanks a lot.
Moving from ruby/GSF to editor/CSL. Step one: assign to myself ;-)
Step 2: trying to make the owner not myself but the owner of the subcomponent.
With the use of api.java.classpath and PHP specific classpath IDs this I believe should work. Please check again and if there is still a problem in the infrastructure reassign back. Thanks
Verified, works for me for Global Include Path as well as project's Include Path. Warning from project customizer removed. http://hg.netbeans.org/web-main/rev/87896977f7e8 Product Version: NetBeans IDE Dev (Build 090320) Java: 1.5.0_16; Java HotSpot(TM) 64-Bit Server VM 1.5.0_16-b02 System: Linux version 2.6.27-11-generic running on amd64; UTF-8; cs_CZ (nb)
Integrated into 'main-golden', will be available in build *200903210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/87896977f7e8 User: Tomas Mysik <tmysik@netbeans.org> Log: Additional fix related to #139705: CC not work immediat. after adding fold. into global include path Just warning removed, not needed any more.