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.
Created attachment 134851 [details] Stack trace I think JDK 8 must allow deeper stacks because I have never seen a stack trace like the one I'm attaching. It appears to be recursing endlessly on itself, and the IDE has been hung for 5 minutes.
AngularJsEmbeddingProviderPlugin which is called from EmbeddingProvider for javascript content queries the JsIndex which calls QuerySupport.query() which then tries to update the index via javascript EmbeddingIndexer which requires the embedded js virtual source == cycle. I'm not sure if it is allowed to access the index from an EmbeddingProvider, so passing to Tomas Zezula which should confirm that. There's also some kind of caching of the JsIndex queries implemented in JsIndex, but in this case is apparently invalidated as the QuerySupport is called. Tome, please take a look at the stack and tell us if we can do such call or not, thank you.
Most, if not all, embedded JS expressions in HTML will be referencing members of the $scope variable (which the parser would have to synthesize somehow). Angular embedding also allows expressions which are not quite legal Javascript, such as <span ng-repeat="(key,value) in dictionary"> or filtering values ala <span ng-model="item.created | date"> So, while the syntax highlighting is nice to have, it will either need some sort of enhanced embedded parser or other special handling. Might be worth thinking about when solving this. So given that much of the embedded js will be illegal, and the rest will reference members on a variable that isn't declared anywhere, it wouldn't be the worst idea to avoid trying to do anything too complex for these expressions.
Tim, there is already some simple support of these expressions. It's implemented for ng-repeat for example. The problem that is now discussed here is more general. The solution would be probably to create somehow the virtual source without the knowledge about the properties of the controller.
*** Bug 230218 has been marked as a duplicate of this bug. ***
The problem is in AngularJsEmbeddingProviderPlugin which calls the JsIndex.query(). The EmbeddingProviderPlugin is called during the creation of the index so such a call causes a recursion. We can change the indexing to allow the Indexers (EmbeddingProviders, Parsers) to call to index however it's questionable they cannot see the data actually written just the last generation of the data which is probably not very useful.
*** Bug 231138 has been marked as a duplicate of this bug. ***
Created attachment 135707 [details] Proposed fix.
I've attached patch allowing the indexers to do queries during index building. I am not sure if the query dome by the AngularJsEmbeddingProviderPlugin is intentional or not. If it is the attached patch should help. Marku, can you test the patch?
Thanks for the investigation and the patch Tomas. Marek is on vacation until the end of the week - Petr P, can you please try this out? BTW, is this a beta stopper? We may want to elevate this to P1.
I'm going to look at this.
Tome, with the patch I can not reproduce it. As the hot fix it could be ok. We don't need to store the right information in the index from the file, where it happened. For us is important to build the virtual source for code completion. So when the initial scan is done and in this time all other sources are already scanned. Anyway I will try to change the way how we generate the virtual source to don't use index in the future. Tome are you going to apply the patch?
After offline discussion with Tomas, assigning to Tomas.
Yes. I am going to integrate it.
Fixed jet-main 4914c3f0ebf2
Tomas thanks.
This bugfix did not make it before the branching of 7.4 beta, but IMO it is a beta stopper. Marian, what is the process, can it be merged to the beta branch?
Yes, please do it ASAP. Thanks in advance.
Integrated 7.4 beta into http://hg.netbeans.org/releases/rev/f2472c9941bc
Integrated into 'releases', will be available in build *201306132201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/f2472c9941bc User: Tomas Zezula <tzezula@netbeans.org> Log: #230220:Endless loop in AngularJsEmbeddingProviderPlugin.processController
Integrated into 'main-golden', will be available in build *201306142301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4914c3f0ebf2 User: Tomas Zezula <tzezula@netbeans.org> Log: #230220:Endless loop in AngularJsEmbeddingProviderPlugin.processController