Inline JSDoc. Code completion NOT work

Feature requests
Post Reply
Sorbing
Posts: 27
Joined: Wed Oct 19, 2011 2:52 pm
Location: Ukraine, Kyiv
Contact:

Inline JSDoc. Code completion NOT work

Post by Sorbing » Wed Oct 19, 2011 3:12 pm

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.

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by eric_suen » Wed Oct 19, 2011 4:35 pm

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?

Sorbing
Posts: 27
Joined: Wed Oct 19, 2011 2:52 pm
Location: Ukraine, Kyiv
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by Sorbing » Wed Oct 19, 2011 8:29 pm

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?

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by eric_suen » Thu Oct 20, 2011 3:52 am

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?

Sorbing
Posts: 27
Joined: Wed Oct 19, 2011 2:52 pm
Location: Ukraine, Kyiv
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by Sorbing » Thu Oct 20, 2011 7:34 am

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!

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by eric_suen » Thu Oct 20, 2011 8:55 am

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

Sorbing
Posts: 27
Joined: Wed Oct 19, 2011 2:52 pm
Location: Ukraine, Kyiv
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by Sorbing » Thu Oct 20, 2011 2:29 pm

Thanks for the fix.
But this fix will be included in future versions Spket?

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: Inline JSDoc. Code completion NOT work

Post by eric_suen » Thu Oct 20, 2011 5:04 pm

yes

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest