TypeScript/tests/cases/fourslash/findAllRefsJsDocTemplateTag_class_js.ts
Nathan Shively-Sanders 8d969a23cb
In JS, class supports @template tag for declaring type parameters (#23511)
* Support @template as a class type parameter

Still need to do the following:
1. Correctly get jsdoc host in predicate.
2. Make this work for constructor functions too.
3. Scan rest of codebase for other usages of the type parameters
property that should be calls to getEffectiveTypeParameterDeclarations.
4. Rename tp to something more readable, like typar or ts'.

* Use jsdoc host declaration to find container

* Longer names for type parameters

* Fix renaming operation

* Update fourslash test

* Support @template for JS constructors

* Look for both outer and tag type parameters

* Improve naming to improve code clarity
2018-04-19 15:58:43 -07:00

17 lines
383 B
TypeScript

/// <reference path='fourslash.ts'/>
// @allowJs: true
// @Filename: /a.js
// Both uses of T should be referenced.
/////** @template [|{| "isWriteAccess": true, "isDefinition": true |}T|] */
////class C {
//// constructor() {
//// /** @type {[|T|]} */
//// this.x = null;
//// }
////}
verify.singleReferenceGroup("(type parameter) T in C<T>", test.ranges());