jsdoc-tsimport-plugin icon indicating copy to clipboard operation
jsdoc-tsimport-plugin copied to clipboard

Parser fails for Object["property"] syntax for successfully imported types

Open jcurtis-cc opened this issue 2 years ago • 0 comments

This plugin works great to resolve import syntax like so:

/** @typedef {import("../bakery").Cake} Cake */

But VSCode requires that properties on these types used in other JSDoc annotations use this Object["property"] syntax, not dot syntax (reserved for namespaces). So this fails to parse and JSDoc will throw:

/** 
 * @param {string} name 
 * @param {Cake["icing"]} icing
 * @returns {Cake} Returns new {@link Cake} on success.
 */
function makeACake(name, icing) {
  ... cake making stuff
}

jcurtis-cc avatar Apr 25 '23 01:04 jcurtis-cc