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.

Bug 225705

Summary: knockout code completion
Product: javascript Reporter: nbjsdeveloper
Component: EditorAssignee: Petr Pisl <ppisl>
Status: RESOLVED FIXED    
Severity: normal CC: pjiricka, vriha
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 229318    

Description nbjsdeveloper 2013-02-04 12:31:00 UTC
Whenever you attach knockout library to an HTML5 project, the ko global variable is not available hence code completion does not work for knockout (regardless version).
Comment 1 Vladimir Riha 2013-02-04 12:45:12 UTC
Try to invoke code completion twice, that shows ko for me. I guess the same could be necessary for its properties (I tried addTemplate())
Comment 2 nbjsdeveloper 2013-02-04 13:04:26 UTC
(In reply to comment #1)
> Try to invoke code completion twice, that shows ko for me. I guess the same
> could be necessary for its properties (I tried addTemplate())

This action appears to work however:

1) I cannot get the observable() nor observableArray()function to be autocompleted with the minified version (attaching the unminified version it does autocomplete).

2) I cannot navigate to the object definition through the link.
Comment 3 Vladimir Riha 2013-02-04 14:37:06 UTC
It was just a hint to get at least some completion. I think 2) is consequence of fact that ko was not resolved.

Ad the minified version, the observableArray() seems to be declared like this:

b.b("observableArray",b.R)

that could be the reason it is not offered by completion. In debug knockout.js, it is declared more intuitively

ko.observableArray = function(initialValues) {...}
Comment 4 nbjsdeveloper 2013-02-04 15:31:35 UTC
(In reply to comment #3)
> It was just a hint to get at least some completion. I think 2) is consequence
> of fact that ko was not resolved.
> 
> Ad the minified version, the observableArray() seems to be declared like this:
> 
> b.b("observableArray",b.R)
> 
> that could be the reason it is not offered by completion. In debug knockout.js,
> it is declared more intuitively
> 
> ko.observableArray = function(initialValues) {...}

Ok, anyway this will eventually be resolved as other bugs. Am I right?

Is this an already known issue/are you already working on this?

Thanks!
Comment 5 Petr Pisl 2013-02-04 16:34:41 UTC
The object definition through the link works only inside one file. There was not time to implement this to work cross file. I will add this ASAP. So lets keep this as reminder.

@nbjsdeveloper: What do you exactly mean with the latest comment?. 

IMHO this is not P2, I'm downgrading the issue to P3. I hope there will not be any objections.
Comment 6 nbjsdeveloper 2013-02-04 19:39:30 UTC
(In reply to comment #5)
> The object definition through the link works only inside one file. There was
> not time to implement this to work cross file. I will add this ASAP. So lets
> keep this as reminder.
> 
> @nbjsdeveloper: What do you exactly mean with the latest comment?. 
> 
> IMHO this is not P2, I'm downgrading the issue to P3. I hope there will not be
> any objections.

I meant the issue experienced with the minified version of knockout and the double space bar needed to get the completion to work.
Comment 7 Petr Pisl 2013-05-31 07:57:29 UTC
The knockout support was added in NB 7.4. Marking as fixed.