Skip to content

In JS, @template doesn't work on prototype methods #11492

@waderyan

Description

@waderyan

From @benjaminmillhouse on October 6, 2016 19:18

  • VSCode Version: 1.5.3
  • OS Version: macOS 10.12

@template JSDoc comments are not recognized if applied directly to a prototype function definition.

/** @constructor */
function Foo() { }
/**
* @template T
* @param {T} bar
* @returns {T}
*/
Foo.prototype.foo = function (bar) {
};
new Foo().foo({id: 1234}). // Intellisense will not provide any recommendations in this example

Edit from @waderyan: added syntax specifier to code block

Copied from original issue: microsoft/vscode#13307

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions