Page 1 of 1

Inline JSDoc. Code completion NOT work

Posted: Wed Oct 19, 2011 3:12 pm
by Sorbing
Hello.
Prompt why Spket not working code completion for inline JSDoc comments?
Right JSDoc inline comment is a code of:

Code: Select all

function test(/**Array*/ data) {
	data.{cursore} // NOT work code completion
}
But Spket only works with the comment:

Code: Select all

function test(/*Array*/ data) {
	data.{cursore} // WORK code completion
}
Why? JSEclipse, for example, understands the first (correct) example.
Spket Editor v.1.6.18 as plugin for Eclipse 3.7.1.
The correct syntax for jsdoc-toolkit: http://code.google.com/p/jsdoc-toolkit/wiki/InlineDocs
Replacement of the file com.spket.js_1.6.18.jar does not work.

Re: Inline JSDoc. Code completion NOT work

Posted: Wed Oct 19, 2011 4:35 pm
by eric_suen
Because Doc comment is for document, inline comment is for code assist, you should not mix two things together.
Besides, it only works for function in jsdoc-toolkit, so why not just use standard doc comment?

Re: Inline JSDoc. Code completion NOT work

Posted: Wed Oct 19, 2011 8:29 pm
by Sorbing
Here is an example of using inline JSDoc comment:

Code: Select all

var forms = $('form');
$.map(forms, function(i, /*jQuery*/form) {
    form.{cursor} // Code completion for jQuery WORK ))
});
According to what standards Spket uses the inline comments - / * * / instead of / ** * /?
And where is this documented feature?

Re: Inline JSDoc. Code completion NOT work

Posted: Thu Oct 20, 2011 3:52 am
by eric_suen
1st, jsdoc-toolkit is not standards, 2nd, there is no standards for JSDoc, only standards for JavaDoc, according JavaDoc, The first sentence of each doc comment should be a summary sentence, containing a concise but complete description of the API item. This means the first sentence of each member, class, interface or package description.

obviously /**JQuery*/ is not a description, so why you use doc comment?

You do know that /** */ is doc comment, right?

Re: Inline JSDoc. Code completion NOT work

Posted: Thu Oct 20, 2011 7:34 am
by Sorbing
Thanks for your answers.
The last question)) How to specify the type of the variable in that record:

Code: Select all

/**@type {String} el*/
var el = els[0];
Use braces

Code: Select all

/**@type {String} el*/
or simply write

Code: Select all

/**@type String el*/
Thank you very much!

Re: Inline JSDoc. Code completion NOT work

Posted: Thu Oct 20, 2011 8:55 am
by eric_suen
Spket supports both, I have uploaded a quick fix - http://www.agpad.com/downloads/com.spket.js_1.6.18.jar

Code: Select all

function test(/**Array*/ data) {
   data.{cursore} // NOT work code completion
}
use doc comment for inline type should works now

Re: Inline JSDoc. Code completion NOT work

Posted: Thu Oct 20, 2011 2:29 pm
by Sorbing
Thanks for the fix.
But this fix will be included in future versions Spket?

Re: Inline JSDoc. Code completion NOT work

Posted: Thu Oct 20, 2011 5:04 pm
by eric_suen
yes