-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Description
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.