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

JSDoc Class extending Array not supported (?) #30176

Open
kinsi55 opened this issue Mar 1, 2019 · 0 comments
Open

JSDoc Class extending Array not supported (?) #30176

kinsi55 opened this issue Mar 1, 2019 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@kinsi55
Copy link

kinsi55 commented Mar 1, 2019

Got a Class that Extends Array (FooArray) and am trying to create a Typed FooArray in another place. JSDoc suggests that I would be correct by using FooArray.<Type> (As the "normal" suggested method is either Type[] or Array.<Type>) and this markdown indeed seems to be parsed by jsdoc without issues, however VSC ends up detecting neither FooArray nor Type

Full example:

/**
 * @class FooArray
 * @extends {Array}
 */
class FooArray extends Array {
	constructor() {
		super();
		//whatever
	}


	/**
	 * returns "baz"
	 * @returns {string}
	 */
	bar() {
		return "baz";
	}
};

//This array will be filled with only values of type XYZ

/** @type {Array.<XYZ>} => instance[0] is correctly tagged / detected, instance.bar() is not (Obviously) */
/** @type {FooArray} => instance.bar() is documented but JSDoc has no idea of the values in the Array */
/** @type {FooArray.<XYZ>} => Neither is detected / documented */
let instance = new FooArray();
@vscodebot vscodebot bot assigned mjbvz Mar 1, 2019
@mjbvz mjbvz transferred this issue from microsoft/vscode Mar 2, 2019
@mjbvz mjbvz removed their assignment Mar 2, 2019
@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Mar 7, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants