Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multi-line JSDoc tags #53161

Closed
isochronous opened this issue Jun 27, 2018 · 2 comments
Closed

Support for multi-line JSDoc tags #53161

isochronous opened this issue Jun 27, 2018 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues

Comments

@isochronous
Copy link

My apologies if this is not the correct place for this suggestion, but I couldn't find any better places to suggest it.

Basically, I'd really love it if the JSDoc parser that VS Code uses for JavaScript (not TypeScript) intellisense supported multi-line tags. I know it's possible, as WebStorm/IntelliJ has supported this feature for years.

For example, if I want to fully document my event handlers when using Polymer, each handler method requires all of these @param tags to parse correctly:

/**
* @param {Object} event
* @param {Object} event.details
* @param {String} event.details.foo
* @param {Number} event.details.bar
*/
_someEventHandler(event) {
    /* snip */
}

I can simplify this a bit by using this instead:

/**
* @param {{details: {foo: String, bar:Number}}} event
*/
_someEventHandler(event) {
    /* snip */
}

But that's not exactly readable, and its readability decreases for every additional property on Object.details. This would be my ideal solution:

/**
* @param {{
*     details: {
*         foo: String, 
*         bar:Number
*     }
* }} event
*/
_someEventHandler(event) {
    /* snip */
}

Or when using @typedef tags, rather than doing this:

/**
* @typedef {Object} myCustomType
* @property {String} foo
* @property {Number} bar
* @property {Boolean} baz
*/

I could just do this instead:

/**
* @typedef {{
*     foo: String,
*     bar: Number,
*     baz: Boolean
* }} myCustomType
*/

Whereas right now all I can do to simplify it is:

/**
* @typedef {{foo: String, bar: Number, baz: Boolean}} myCustomType
*/

Which again, is less readable, and gets more unreadable the more properties you have to document.

@vscodebot vscodebot bot added the javascript JavaScript support issues label Jun 27, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Jun 27, 2018

Thanks for the detailed report.

I believe this is already being tracked here microsoft/TypeScript#16179 and here atom/language-javascript#515

@mjbvz mjbvz closed this as completed Jun 27, 2018
@mjbvz mjbvz added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 27, 2018
@isochronous
Copy link
Author

isochronous commented Jun 28, 2018 via email

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

2 participants