Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CoffeeScript JSDoc support in PhpStorm/WebStorm

Is there a way to use JSDoc to annotate source code written in CoffeeScript when working in PhpStorm/WebStorm? When working in the IDE, it is very helpful to be able to use JSDoc to have proper code completion for functions.

I found this past question: How to document CoffeeScript source code with JSDoc? However, the answers and comments are not clear on whether it is supported or what the proper syntax is.

like image 718
zacharyliu Avatar asked Aug 06 '13 14:08

zacharyliu


People also ask

Does PhpStorm support JavaScript?

With PhpStorm, you can develop modern web, mobile, and desktop applications with JavaScript and Node. js. PhpStorm also supports React, Angular, Vue. js, and other frameworks and provides tight integration with various tools for web development.

Does JSDoc work with TypeScript?

You can use most JSDoc type syntax and any TypeScript syntax, from the most basic like string to the most advanced, like conditional types.

What is JSDoc used for?

JSDoc is a markup language used to annotate JavaScript source code files. Using comments containing JSDoc, programmers can add documentation describing the application programming interface of the code they're creating.

Is JSDoc built in?

By default, JSDoc uses the built-in "default" template to turn the documentation into HTML. You can edit this template to suit your own needs or create an entirely new template if that is what you prefer. This command will create a directory named out/ in the current working directory.


2 Answers

Here is an updated answer for anyone who comes across this thread in the future. WebStorm 2017.3 (the current version as of this writing) has support for CoffeeScript javadocs.

The basic syntax is this:

###*
 * Here is a simple description for foo
 * @param {Bar} bar - Some parameter to foo
 * @returns {Object} The thing that foo returns
###
foo = (bar) ->

WebStorm will give you the documentation when you press ctrl+Q.

like image 139
Nathan Avatar answered Nov 09 '22 22:11

Nathan


Unfortunately this is not currently supported. Pleasze feel free to file a request for this feature to youtrack

like image 45
lena Avatar answered Nov 10 '22 00:11

lena