mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 10:00:13 -06:00
Clean up TODOs for #18445
This commit is contained in:
parent
db3f7c538e
commit
3ca1cc406a
@ -2568,9 +2568,7 @@ Actual: ${stringify(fullActual)}`);
|
||||
const originalContent = scriptInfo.content;
|
||||
for (const codeFix of codeFixes) {
|
||||
this.applyEdits(codeFix.changes[0].fileName, codeFix.changes[0].textChanges, /*isFormattingEdit*/ false);
|
||||
let text = this.rangeText(ranges[0]);
|
||||
// TODO:GH#18445 (remove this line to see errors in many `importNameCodeFix` tests)
|
||||
text = text.replace(/\r\n/g, "\n");
|
||||
const text = this.rangeText(ranges[0]);
|
||||
actualTextArray.push(text);
|
||||
scriptInfo.updateContent(originalContent);
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
verify.codeFix({
|
||||
description: "Declare property 'foo'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
foo: number;
|
||||
method() {
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
verify.codeFix({
|
||||
description: "Add index signature for property 'foo'",
|
||||
index: 1,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
[x: string]: number;
|
||||
method() {
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
verify.codeFix({
|
||||
description: "Declare static property 'foo'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
static foo: number;
|
||||
static method() {
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
verify.codeFix({
|
||||
description: "Initialize property 'foo' in the constructor",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
constructor() {
|
||||
this.foo = undefined;
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
verify.codeFix({
|
||||
description: "Initialize static property 'foo'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
static method() {
|
||||
()=>{ this.foo === 10 };
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
verify.codeFix({
|
||||
description: "Initialize property 'foo' in the constructor",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
constructor() {
|
||||
this.foo = undefined;
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
verify.codeFix({
|
||||
description: "Initialize static property 'foo'",
|
||||
index: 2,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
static p = ()=>{ this.foo === 10 };
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
verify.codeFixAll({
|
||||
fixId: "addMissingMember",
|
||||
newFileContent:
|
||||
// TODO: GH#18445
|
||||
`class C {
|
||||
x: number;
|
||||
y(): any {
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
verify.codeFixAll({
|
||||
fixId: "addMissingMember",
|
||||
newFileContent:
|
||||
// TODO: GH#18445
|
||||
`class C {
|
||||
y() {
|
||||
throw new Error("Method not implemented.");
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFixAll({
|
||||
fixId: "fixClassDoesntImplementInheritedAbstractMember",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
abstract m(): void;
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
abstract x: this;
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
protected abstract x: number;
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
public abstract x: number;
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
private _a: string;
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`class A {
|
||||
f() {}
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`class A {
|
||||
method(a: number, b: string): boolean;
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`class A {
|
||||
method(a: any, b: string): boolean;
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
abstract x: number;
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`class A {
|
||||
A: typeof A;
|
||||
|
||||
@ -50,7 +50,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I6'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`// Referenced throughout the inheritance chain.
|
||||
interface I0 { a: number }
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I { x: number; }
|
||||
export default class implements I {
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
x: number[];
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I { x: number; }
|
||||
new class implements I {
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'N.I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`namespace N {
|
||||
/**enum prefix */
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
["foo"](o: any): boolean;
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<number>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<Species> {
|
||||
[Symbol.hasInstance](o: any): boolean;
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'N1.I1'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`namespace N1 {
|
||||
export interface I1 {
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
[x: number]: I;
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
[x: number]: I;
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<number>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<X> {
|
||||
[Ƚ: string]: X;
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<Y>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<X> {
|
||||
x: keyof X;
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I1'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`abstract class C1 { }
|
||||
abstract class C2 {
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<Y>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<X> {
|
||||
x: { readonly [K in keyof X]: X[K] };
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`type Either<T> = { val: T } | Error;
|
||||
interface I {
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`/** asdf */
|
||||
interface I {
|
||||
|
||||
@ -6,7 +6,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`type MyType = [string, number];
|
||||
interface I { x: MyType; test(a: MyType): void; }
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
f(x: number, y: this): I
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
f(i: any): i is I;
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I1'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I1 {
|
||||
x: number,
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
method(a: number, b: string): boolean;
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
method(a: number, ...b: string[]): boolean;
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
method(a: number, ...b: string[]): boolean;
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'N1.I1'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`namespace N1 {
|
||||
export interface I1 { x: number; }
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'IPerson'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface IPerson {
|
||||
name: string;
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`enum E { a,b,c }
|
||||
interface I {
|
||||
|
||||
@ -21,7 +21,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I {
|
||||
a0: {};
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'N.I'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`namespace N {
|
||||
export interface I { y: I; }
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<number>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<T> {
|
||||
x: { y: T, z: T[] };
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<number>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<T> { x: T; }
|
||||
class C implements I<number> {
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<T>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<T> { x: T; }
|
||||
class C<T> implements I<T> {
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I<U>'",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`interface I<T> { x: T; }
|
||||
class C<U> implements I<U> {
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'I'",
|
||||
newFileContent:
|
||||
// TODO: GH#18445
|
||||
`interface I {
|
||||
f<T extends number>(x: T);
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
verify.codeFixAll({
|
||||
fixId: "fixClassIncorrectlyImplementsInterface",
|
||||
// TODO: GH#20073 GH#18445
|
||||
// TODO: GH#20073
|
||||
newFileContent:
|
||||
`interface I { i(): void; }
|
||||
interface J { j(): void; }
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
//// super();
|
||||
//// |]}
|
||||
////}
|
||||
// TODO: GH#18445
|
||||
verify.rangeAfterCodeFix(`
|
||||
super();
|
||||
this.a = 12;
|
||||
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
verify.codeFix({
|
||||
description: "Add missing 'super()' call",
|
||||
// TODO: GH#18445
|
||||
newFileContent:
|
||||
`class Base{
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
|
||||
verify.codeFixAll({
|
||||
fixId: "constructorForDerivedNeedSuperCall",
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C extends Object {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
verify.codeFix({
|
||||
description: "Declare static method 'm1'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newRangeContent: `
|
||||
static m1(arg0: any, arg1: any, arg2: any): any {
|
||||
throw new Error("Method not implemented.");
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
verify.codeFix({
|
||||
description: "Declare method 'foo1'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newRangeContent: `
|
||||
foo1(arg0: any, arg1: any, arg2: any): any {
|
||||
throw new Error("Method not implemented.");
|
||||
|
||||
@ -17,7 +17,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import f_o_o from "./a";
|
||||
import foo from "./a";
|
||||
f;`,
|
||||
|
||||
@ -22,7 +22,6 @@ verify.applyCodeActionFromCompletion("1", {
|
||||
name: "fooBar",
|
||||
source: "/src/foo-bar",
|
||||
description: `Import 'fooBar' from module "./foo-bar"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import fooBar from "./foo-bar";
|
||||
|
||||
def
|
||||
|
||||
@ -18,7 +18,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import foo from "./a";
|
||||
|
||||
f;`,
|
||||
|
||||
@ -19,7 +19,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import foo from "./a";
|
||||
|
||||
f;`,
|
||||
|
||||
@ -12,7 +12,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "x",
|
||||
source: "m",
|
||||
description: `Import 'x' from module "m"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { x } from "m";
|
||||
|
||||
`,
|
||||
|
||||
@ -23,7 +23,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/b",
|
||||
description: `Import 'foo' from module "./b"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./b";
|
||||
|
||||
fo`,
|
||||
|
||||
@ -19,7 +19,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";
|
||||
|
||||
f;`,
|
||||
|
||||
@ -17,7 +17,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Change 'foo' to 'a.foo'`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import * as a from "./a";
|
||||
a.f;`,
|
||||
});
|
||||
|
||||
@ -29,7 +29,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";
|
||||
|
||||
fo`,
|
||||
|
||||
@ -24,7 +24,6 @@ verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/foo/lib/foo",
|
||||
description: `Import 'foo' from module "./foo"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./foo";
|
||||
|
||||
fo`,
|
||||
|
||||
@ -23,7 +23,6 @@ verify.applyCodeActionFromCompletion("b", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";
|
||||
|
||||
const a = require("./a");
|
||||
@ -40,7 +39,6 @@ verify.applyCodeActionFromCompletion("c", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";
|
||||
|
||||
const a = import("./a");
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
////x;|]
|
||||
|
||||
goTo.file("/b.ts");
|
||||
// TODO:GH#18445
|
||||
verify.rangeAfterCodeFix(`import { x } from "./a";
|
||||
|
||||
export { x } from "./a";
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
verify.applicableRefactorAvailableAtMarker('1');
|
||||
// NOTE: '// Comment' should be included, but due to incorrect handling of trivia,
|
||||
// it's omitted right now.
|
||||
// TODO: GH#18445
|
||||
verify.fileAfterApplyingRefactorAtMarker('1',
|
||||
`class fn {\r
|
||||
constructor() {\r
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user