Edward Tanguay
Edward Tanguay

Reputation: 193322

Is there a way to get VSCode to display addition intellisense information about JavaScript functions from their comment lines?

Visual Studio Code provides displays useful hover-over information about a function in a JavaScript module, like this:

enter image description here

Is there a way to get it also display a comment line above the function so that one can have additional information about the function displayed, e.g. examples of how to use the function?

enter image description here

I remember this was possible in NetBeans with PHPDoc, for example.

Upvotes: 1

Views: 91

Answers (1)

kai
kai

Reputation: 6887

Use JS-Doc format. Then it should work. https://jsdoc.app/

/**
 * Some comment
 */
export const replaceAll = (text: string, search: string, replace: string) => {
    return text.split(search).join(replace);
};

Upvotes: 3

Related Questions