* Revert "Revert "Editor support for link tag (#41877)" (#43302)"
This reverts commit 451d4354b9
.
* Fix parsing @link at end of comment
* Parse comments as string when no @link occurs
* fix lint
43 lines
1 KiB
TypeScript
43 lines
1 KiB
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @noImplicitAny: true
|
|
// @strictNullChecks: true
|
|
// @Filename: important.js
|
|
////class C {
|
|
//// constructor() {
|
|
//// /** this is fine */
|
|
//// this.p = undefined;
|
|
//// this.q = undefined
|
|
//// }
|
|
//// method() {
|
|
//// this.p.push(1)
|
|
//// this.q.push(1);
|
|
//// }
|
|
////}
|
|
|
|
// Note: Should be number[] | undefined, but inference currently privileges assignments
|
|
// over usage (even when the only result is undefined) and infers only undefined.
|
|
verify.codeFixAll({
|
|
fixId: "inferFromUsage",
|
|
fixAllDescription: "Infer all types from usage",
|
|
newFileContent:
|
|
`class C {
|
|
constructor() {
|
|
/**
|
|
* this is fine
|
|
* @type {number[] | undefined}
|
|
*/
|
|
this.p = undefined;
|
|
/**
|
|
* @type {number[] | undefined}
|
|
*/
|
|
this.q = undefined
|
|
}
|
|
method() {
|
|
this.p.push(1)
|
|
this.q.push(1);
|
|
}
|
|
}`});
|