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.
Basically no completion is offered for the active binding context object fields/methods. Try to invoke completion in the following example: 1) the foreach part - the completion for "text" binding value should provide the fields/methods of the active binding context object (Clobrda as the item of the lidickove array), which it doesn't. It offers no items for no prefix and offers incorrect items (fields of the root model) if one uses $data implicit variable. 2) the with part - the completion for "text" binding value should provide the fields/methods of the active binding context object (Clobrda), which it doesn't. It offers no items for no prefix and no items if one uses $data implicit variable. Please take this as a description of the behaviour I would expect. I understand that at least some parts may not be easily doable. ----------------------------------------------------- <!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300italic,400,700,900" rel="stylesheet" /> <link href="styles/expenses.css" rel="stylesheet"/> <style> .jouda { color: red; } .king { color: green; } </style> <script src="libs/knockout-2.2.1.js"></script> <script> function Bulici() { this.pepa = new Clobrda("pepa"); this.lidickove = [ this.pepa, new Clobrda("jozin")]; } function Clobrda(jmeno) { this.jmeno = jmeno; } function init() { ko.applyBindings(new Bulici()); } </script> </head> <body onload="init();"> <span data-bind="foreach: lidickove "> <div data-bind="text: jmeno, css: jmeno == 'pepa' ? 'jouda' : 'king'"></div> </span> <hr> <span data-bind="with: pepa"> <div data-bind="text: jmeno"></div> </span> </body> </html>
To reproduce the issue you need to remove the rest of the code to the point where you want to test the completion so the "auto-learning-completion" won't provide the items seen in the code.
1) Depends on #230501. 2) I have a patch for that in my local repo. Though there might be some more minor issues in type resolution is core JS module.
2) fixed in web-main 75d46ba1a613
Theoretically this should be fixed. However in this Marek's sample the array is not properly resolved afaik. The relevant part of virtual source is (^) for cursor: (function() { var $root = ko.$bindings; var $parent = ko.$bindings; var $parents = [ko.$bindings]; var $index = 0; with (ko.$bindings) { var $data = lidickove[0]; with (lidickove[0]) { (^); } } }); The properties of lidickove[0] is not offered in cc. The similar case with "with" works ok: (function() { var $root = ko.$bindings; var $parent = ko.$bindings; var $parents = [ko.$bindings]; with (ko.$bindings) { var $data = pepa; with (pepa) { (^); } } });
Tests added - web-main c012b37bceb4.
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/75d46ba1a613 User: Petr Hejl <phejl@netbeans.org> Log: #230123 - foreach and with completion issues
It looks like the problem is in SemiTypeResolverVisitor which still does not support arrays.
I'll try to fix it.
Hopefully should be fixed in web-main. 9189cb4092df a4a23ce73a2e 59ff80604f60