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.
For now in CND we would like to use parsing API but not indexing API and it looks like registering a path in GlobalPathRegistry is not enough. TaskProcessor is not created until the first access and so on. So the hack we're using now is to intialize all schedulers by hand in project opening hook like: for(Scheduler s : Lookup.getDefault().lookupAll(Scheduler.class)) {} (I took this hack from ClassMemberPanel) That would be better to have this triggered on GlobalPathRegistry.register.
(In reply to comment #0) > For now in CND we would like to use parsing API but not indexing API and it > looks like registering a path in GlobalPathRegistry is not enough. Actually, I think that the parsing part of parsing.api should work even if nothing is registered in GPR. Only indexing part should depend on GPR. > TaskProcessor is not created until the first access and so on. So the hack > we're using now is to intialize all schedulers by hand in project opening hook > like: > for(Scheduler s : Lookup.getDefault().lookupAll(Scheduler.class)) {} > (I took this hack from ClassMemberPanel) > That would be better to have this triggered on GlobalPathRegistry.register. The bug appears to be in: parsing.api/src/org/netbeans/modules/parsing/impl/Schedulers.java.init: taskSchedulers = Lookup.getDefault ().lookupAll (Scheduler.class); Which apparently tries to instantiate and initialize all the Schedulers. This might have work when the code was introduced, but I am pretty sure it does virtually nothing now, as (I think) lookupAll is now lazy. One actually needs to iterate the collection to force the instantiation of the Schedulers. (I think that this code, to be fully correct, should do lookupResult, listen on the result and list all instances whenever the result changes. Otherwise Schedulers in newly enabled modules may remain uninitialized. That's the fun with NB Lookup.)
if it does not requre GPR it will be even better, then there will be no issues with other indexers overhead
Can this be fixed in 7.4? We may try to use some of the Parsing API soon.
Fixed jet-main a600132f16ca
verified in trunk, thanks!