• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Where can I find description for @fileoverview , @class, @see, @constructor, @return @type ?

Engaged ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

In the code example for ScriptUI, SnpCreateUIAddMethod.jsx,
https://github.com/Adobe-CEP/CEP-Resources/blob/master/ExtendScript-Toolkit/Samples/javascript/SnpCr...,
have the following lines
-------------------------------------------------- ------------------
@fileoverview , @class, @SEE, @constructor, @Return @TyPe,
SnpCreateUIAddMethod.prototype.run = function()
-------------------------------------------------- ------------------

I can't find a description of these lines in the manual...
Are these lexemes of some programming language? What language is this?

TOPICS
Scripting

Views

383

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Guide , Apr 11, 2023 Apr 11, 2023

It's JSDoc annotating JavaScript.  Here a list of tags and what they mean. 

Votes

Translate

Translate
Community Expert , Apr 11, 2023 Apr 11, 2023

Hi @AnyON, to add a little to what @femkeblanco has answered, when you see a block comment like this

 

/*
    Block comment here
*/

 

but it starts with slash and two asterisks:

 

/**
    JSDoc ( and is also parsed as a normal block comment
    in non-JSDoc contexts.
*/

 

 then it can be parsed as JSDoc by your IDE (eg. VSCode).

Words starting with @ are JSDoc symbols to represent things in the documentation, eg. "@constructor" and "@param".

 

I like using JSDoc, not just for the value of code d

...

Votes

Translate

Translate
Adobe
Guide ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

It's JSDoc annotating JavaScript.  Here a list of tags and what they mean. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2023 Apr 11, 2023

Copy link to clipboard

Copied

Hi @AnyON, to add a little to what @femkeblanco has answered, when you see a block comment like this

 

/*
    Block comment here
*/

 

but it starts with slash and two asterisks:

 

/**
    JSDoc ( and is also parsed as a normal block comment
    in non-JSDoc contexts.
*/

 

 then it can be parsed as JSDoc by your IDE (eg. VSCode).

Words starting with @ are JSDoc symbols to represent things in the documentation, eg. "@constructor" and "@param".

 

I like using JSDoc, not just for the value of code documentation but for extra bonuses, like getting intellisense when calling a function that is documented with JSDoc.

 

Here is a little example:

 

/**
 * Converts a CompoundPathItem into individual PathItems.
 * @author m1b
 * @version 2023-03-29
 * @param {CompoundPathItem} item - the item to uncompound.
 * @returns {Array<PathItem>} - the individual path items.
 */
function uncompound(item) {

    if (!item.hasOwnProperty('pathItems'))
        return;

    var pathItems = [],
        container = item.parent;

    for (var i = item.pathItems.length - 1; i >= 0; i--) {
        pathItems[i] = item.pathItems[i];
        pathItems[i].move(container, ElementPlacement.PLACEATBEGINNING);
    }

    return pathItems;

};

 

 

So, in VSCode, if I click on a function parameter name "item" and rename symbol (f2) tp "myPathItem" it will also rename the @param in the JSDoc header, which is very helpful.

 

And when I type "uncompound(" VSCode shows me intellisense for the function:

Screenshot 2023-04-11 at 22.05.02.png

Which can be a big time saver when using unfamiliar functions.

- Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 13, 2023 Apr 13, 2023

Copy link to clipboard

Copied

LATEST

Thanks for the detailed answer m1b.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines