Remove periods from refactor/quickfix messages (#20237)
* Fix #19959 and #19958: Remove un-localizable messages * Update message * Reorder error messages * Fix https://github.com/Microsoft/TypeScript/issues/15399: remove periods at the end of messages * Accept baselines for error code changes * accept baselines for removed periods * Update diagnostic messages
This commit is contained in:
parent
8d7c2a2a77
commit
65af685b49
|
@ -2272,6 +2272,10 @@
|
|||
"category": "Error",
|
||||
"code": 2718
|
||||
},
|
||||
"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.": {
|
||||
"category": "Error",
|
||||
"code": 2719
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
@ -2719,6 +2723,11 @@
|
|||
"category": "Error",
|
||||
"code": 5067
|
||||
},
|
||||
"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.": {
|
||||
"category": "Error",
|
||||
"code": 5068
|
||||
},
|
||||
|
||||
"Concatenate and emit output to single file.": {
|
||||
"category": "Message",
|
||||
"code": 6001
|
||||
|
@ -3710,7 +3719,7 @@
|
|||
},
|
||||
"JSX fragment is not supported when using --jsxFactory": {
|
||||
"category": "Error",
|
||||
"code":17016
|
||||
"code": 17016
|
||||
},
|
||||
|
||||
"Circularity detected while resolving configuration: {0}": {
|
||||
|
@ -3730,104 +3739,95 @@
|
|||
"code": 18003
|
||||
},
|
||||
|
||||
"Add missing 'super()' call.": {
|
||||
"Add missing 'super()' call": {
|
||||
"category": "Message",
|
||||
"code": 90001
|
||||
},
|
||||
"Make 'super()' call the first statement in the constructor.": {
|
||||
"Make 'super()' call the first statement in the constructor": {
|
||||
"category": "Message",
|
||||
"code": 90002
|
||||
},
|
||||
"Change 'extends' to 'implements'.": {
|
||||
"Change 'extends' to 'implements'": {
|
||||
"category": "Message",
|
||||
"code": 90003
|
||||
},
|
||||
"Remove declaration for: '{0}'.": {
|
||||
"Remove declaration for: '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90004
|
||||
},
|
||||
"Implement interface '{0}'.": {
|
||||
"Implement interface '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90006
|
||||
},
|
||||
"Implement inherited abstract class.": {
|
||||
"Implement inherited abstract class": {
|
||||
"category": "Message",
|
||||
"code": 90007
|
||||
},
|
||||
"Add 'this.' to unresolved variable.": {
|
||||
"Add 'this.' to unresolved variable": {
|
||||
"category": "Message",
|
||||
"code": 90008
|
||||
},
|
||||
"Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig.": {
|
||||
"category": "Error",
|
||||
"code": 90009
|
||||
},
|
||||
"Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated.": {
|
||||
"category": "Error",
|
||||
"code": 90010
|
||||
},
|
||||
"Import '{0}' from module \"{1}\".": {
|
||||
"Import '{0}' from module \"{1}\"": {
|
||||
"category": "Message",
|
||||
"code": 90013
|
||||
},
|
||||
"Change '{0}' to '{1}'.": {
|
||||
"Change '{0}' to '{1}'": {
|
||||
"category": "Message",
|
||||
"code": 90014
|
||||
},
|
||||
"Add '{0}' to existing import declaration from \"{1}\".": {
|
||||
"Add '{0}' to existing import declaration from \"{1}\"": {
|
||||
"category": "Message",
|
||||
"code": 90015
|
||||
},
|
||||
"Declare property '{0}'.": {
|
||||
"Declare property '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90016
|
||||
},
|
||||
"Add index signature for property '{0}'.": {
|
||||
"Add index signature for property '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90017
|
||||
},
|
||||
|
||||
"Disable checking for this file.": {
|
||||
"Disable checking for this file": {
|
||||
"category": "Message",
|
||||
"code": 90018
|
||||
},
|
||||
"Ignore this error message.": {
|
||||
"Ignore this error message": {
|
||||
"category": "Message",
|
||||
"code": 90019
|
||||
},
|
||||
"Initialize property '{0}' in the constructor.": {
|
||||
"Initialize property '{0}' in the constructor": {
|
||||
"category": "Message",
|
||||
"code": 90020
|
||||
},
|
||||
"Initialize static property '{0}'.": {
|
||||
"Initialize static property '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90021
|
||||
},
|
||||
"Change spelling to '{0}'.": {
|
||||
"Change spelling to '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90022
|
||||
},
|
||||
"Declare method '{0}'.": {
|
||||
"Declare method '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90023
|
||||
},
|
||||
"Declare static method '{0}'.": {
|
||||
"Declare static method '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90024
|
||||
},
|
||||
"Prefix '{0}' with an underscore.": {
|
||||
"Prefix '{0}' with an underscore": {
|
||||
"category": "Message",
|
||||
"code": 90025
|
||||
},
|
||||
"Rewrite as the indexed access type '{0}'.": {
|
||||
"Rewrite as the indexed access type '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90026
|
||||
},
|
||||
"Declare static property '{0}'.": {
|
||||
"Declare static property '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 90027
|
||||
},
|
||||
"Call decorator expression.": {
|
||||
"Call decorator expression": {
|
||||
"category": "Message",
|
||||
"code": 90028
|
||||
},
|
||||
|
@ -3871,11 +3871,11 @@
|
|||
"category": "Message",
|
||||
"code": 95010
|
||||
},
|
||||
"Infer type of '{0}' from usage.": {
|
||||
"Infer type of '{0}' from usage": {
|
||||
"category": "Message",
|
||||
"code": 95011
|
||||
},
|
||||
"Infer parameter types from usage.": {
|
||||
"Infer parameter types from usage": {
|
||||
"category": "Message",
|
||||
"code": 95012
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): error TS90010: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): error TS2719: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
|
||||
|
||||
==== tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts (1 errors) ====
|
||||
|
@ -9,7 +9,7 @@ tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): erro
|
|||
fn() {
|
||||
this.x = a;
|
||||
~~~~~~
|
||||
!!! error TS90010: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2719: Type 'T' is not assignable to type 'T'. Two different types with this name exist, but they are unrelated.
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/app/app.ts(9,1): error TS90010: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
|
||||
/app/app.ts(9,1): error TS2719: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
|
||||
Types have separate declarations of a private property 'x'.
|
||||
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
|||
// Should fail. We no longer resolve any symlinks.
|
||||
x = new C2();
|
||||
~
|
||||
!!! error TS90010: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS90010: Types have separate declarations of a private property 'x'.
|
||||
!!! error TS2719: Type 'C' is not assignable to type 'C'. Two different types with this name exist, but they are unrelated.
|
||||
!!! error TS2719: Types have separate declarations of a private property 'x'.
|
||||
|
||||
==== /linked/index.d.ts (0 errors) ====
|
||||
export { real } from "real";
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Call decorator expression.",
|
||||
description: "Call decorator expression",
|
||||
newRangeContent: `@foo()`
|
||||
});
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Add 'this.' to unresolved variable.",
|
||||
description: "Add 'this.' to unresolved variable",
|
||||
newRangeContent: `
|
||||
this.foo = 10;
|
||||
`
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Add 'this.' to unresolved variable.",
|
||||
description: "Add 'this.' to unresolved variable",
|
||||
newRangeContent: "this.foo = 10",
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare property 'foo'.",
|
||||
description: "Declare property 'foo'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Add index signature for property 'foo'.",
|
||||
description: "Add index signature for property 'foo'",
|
||||
index: 1,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare static property 'foo'.",
|
||||
description: "Declare static property 'foo'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Initialize property 'foo' in the constructor.",
|
||||
description: "Initialize property 'foo' in the constructor",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Initialize static property 'foo'.",
|
||||
description: "Initialize static property 'foo'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Initialize property 'foo' in the constructor.",
|
||||
description: "Initialize property 'foo' in the constructor",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Initialize static property 'foo'.",
|
||||
description: "Initialize static property 'foo'",
|
||||
index: 2,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `class C {
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
//// [|/* */ class /* */ C /* */ extends /* */ I|]{}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'extends' to 'implements'.",
|
||||
description: "Change 'extends' to 'implements'",
|
||||
newRangeContent: "/* */ class /* */ C /* */ implements /* */ I",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//// [|abstract class A extends I1 implements I2|] { }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'extends' to 'implements'.",
|
||||
description: "Change 'extends' to 'implements'",
|
||||
// TODO: GH#18794
|
||||
newRangeContent: "abstract class A implements I1 , I2",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
////[|class C<T extends string , U> extends I<T>|]{}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'extends' to 'implements'.",
|
||||
description: "Change 'extends' to 'implements'",
|
||||
newRangeContent: "class C<T extends string , U> implements I<T>",
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//// @sealed
|
||||
//// [|class A extends I1 implements I2 { }|]
|
||||
verify.codeFix({
|
||||
description: "Change 'extends' to 'implements'.",
|
||||
description: "Change 'extends' to 'implements'",
|
||||
// TODO: GH#18794
|
||||
newRangeContent: "class A implements I1 , I2 { }",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var x: [|?|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '?' to 'any'.",
|
||||
description: "Change '?' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'number?' to 'number | null'.",
|
||||
description: "Change 'number?' to 'number | null'",
|
||||
errorCode: 8020,
|
||||
index: 0,
|
||||
newRangeContent: "number | null",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'string?' to 'string | null | undefined'.",
|
||||
description: "Change 'string?' to 'string | null | undefined'",
|
||||
errorCode: 8020,
|
||||
index: 1,
|
||||
newRangeContent: "string | null | undefined",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
errorCode: 8020,
|
||||
index: 0,
|
||||
newRangeContent: "any",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
errorCode: 8020,
|
||||
index: 0,
|
||||
newRangeContent: "any",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//// var x = 12 as [|number?|];
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'number?' to 'number | null'.",
|
||||
description: "Change 'number?' to 'number | null'",
|
||||
errorCode: 8020,
|
||||
index: 0,
|
||||
newRangeContent: "number | null",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
// note: without --strict, number? --> number, not number | null
|
||||
verify.codeFix({
|
||||
description: "Change 'function(number?): number' to '(arg0: number) => number'.",
|
||||
description: "Change 'function(number?): number' to '(arg0: number) => number'",
|
||||
errorCode: 8020,
|
||||
index: 0,
|
||||
newRangeContent: "(arg0: number) => number",
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var f: { [K in keyof number]: [|*|] };
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// declare function index(ix: number): [|*|];
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var index: { (ix: number): [|?|] };
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '?' to 'any'.",
|
||||
description: "Change '?' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var index: { new (ix: number): [|?|] };
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '?' to 'any'.",
|
||||
description: "Change '?' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var x: [|*|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var index = { get p(): [|*|] { return 12 } };
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var index = { set p(x: [|*|]) { } };
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var index: { [s: string]: [|*|] };
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '*' to 'any'.",
|
||||
description: "Change '*' to 'any'",
|
||||
newRangeContent: "any",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var x: [|Array.<number>|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'Array.<number>' to 'number[]'.",
|
||||
description: "Change 'Array.<number>' to 'number[]'",
|
||||
newRangeContent: "number[]",
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//// var x: [|?number|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '?number' to 'number | null'.",
|
||||
description: "Change '?number' to 'number | null'",
|
||||
errorCode: 8020,
|
||||
index: 0,
|
||||
newRangeContent: "number | null",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
//// var x: [|number?|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'number?' to 'number | null | undefined'.",
|
||||
description: "Change 'number?' to 'number | null | undefined'",
|
||||
index: 1,
|
||||
newRangeContent: "number | null | undefined",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var x: [|!number|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change '!number' to 'number'.",
|
||||
description: "Change '!number' to 'number'",
|
||||
newRangeContent: "number",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var x: [|function(this: number, number): string|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'function(this: number, number): string' to '(this: number, arg1: number) => string'.",
|
||||
description: "Change 'function(this: number, number): string' to '(this: number, arg1: number) => string'",
|
||||
newRangeContent: "(this: number, arg1: number) => string",
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
//// var x: [|function(new: number)|] = 12;
|
||||
|
||||
verify.codeFix({
|
||||
description: "Change 'function(new: number)' to 'new () => number'.",
|
||||
description: "Change 'function(new: number)' to 'new () => number'",
|
||||
newRangeContent: "new () => number",
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////let B = class implements A {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement interface 'A'.",
|
||||
description: "Implement interface 'A'",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `f(): void {\r
|
||||
throw new Error("Method not implemented.");\r
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
////let B = class extends foo("s")<number> {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `a: string | number;\r
|
||||
`
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
////class B extends foo("s")<number> {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `a: string | number;\r
|
||||
`
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
////class C extends A {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `a: string | number;\r
|
||||
b: this;\r
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
////class C extends A {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `f(a: number, b: string): boolean;\r
|
||||
f(a: number, b: string): this;\r
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////class C extends A {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `f(): this {\r
|
||||
throw new Error("Method not implemented.");\r
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////class C extends A<number> {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `f(x: number): number {\r
|
||||
throw new Error("Method not implemented.");\r
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////class C<U> extends A<U> {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `f(x: U): U {\r
|
||||
throw new Error("Method not implemented.");\r
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
////class C extends A {[| |]}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class.",
|
||||
description: "Implement inherited abstract class",
|
||||
// TODO: GH#18795
|
||||
newRangeContent: `x: number;\r
|
||||
y: this;\r
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare static method 'm1'.",
|
||||
description: "Declare static method 'm1'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newRangeContent: `
|
||||
|
@ -21,7 +21,7 @@ verify.codeFix({
|
|||
});
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare static method 'm2'.",
|
||||
description: "Declare static method 'm2'",
|
||||
index: 0,
|
||||
newRangeContent: `
|
||||
static m2(arg0: any, arg1: any): any {\r
|
||||
|
@ -34,7 +34,7 @@ verify.codeFix({
|
|||
});
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare static property 'prop1'.",
|
||||
description: "Declare static property 'prop1'",
|
||||
index: 0,
|
||||
newRangeContent: `
|
||||
static prop1: number;\r
|
||||
|
@ -48,7 +48,7 @@ verify.codeFix({
|
|||
});
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare static property 'prop2'.",
|
||||
description: "Declare static property 'prop2'",
|
||||
index: 0,
|
||||
newRangeContent: `
|
||||
static prop2: string;\r
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare method 'foo1'.",
|
||||
description: "Declare method 'foo1'",
|
||||
index: 0,
|
||||
// TODO: GH#18445
|
||||
newRangeContent: `
|
||||
|
@ -22,7 +22,7 @@ verify.codeFix({
|
|||
});
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare method 'foo2'.",
|
||||
description: "Declare method 'foo2'",
|
||||
index: 0,
|
||||
newRangeContent: `
|
||||
foo2<T, U, V, W, X, Y, Z>(): any {\r
|
||||
|
@ -35,7 +35,7 @@ verify.codeFix({
|
|||
});
|
||||
|
||||
verify.codeFix({
|
||||
description: "Declare method 'foo3'.",
|
||||
description: "Declare method 'foo3'",
|
||||
index: 0,
|
||||
newRangeContent:`
|
||||
foo3<T0, T1, T2, T3, T4, T5, T6, T7>(): any {\r
|
||||
|
|
|
@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Add 'foo' to existing import declaration from "./a".`,
|
||||
description: `Add 'foo' to existing import declaration from "./a"`,
|
||||
newFileContent: `import foo, { x } from "./a";
|
||||
f;`,
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Add 'foo' to existing import declaration from "./a".`,
|
||||
description: `Add 'foo' to existing import declaration from "./a"`,
|
||||
newFileContent: `import foo, * as a from "./a";
|
||||
f;`,
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a".`,
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import f_o_o from "./a";
|
||||
import foo from "./a";\r
|
||||
|
|
|
@ -21,7 +21,7 @@ verify.completionListContains({ name: "fooBar", source: "/src/foo-bar" }, "(prop
|
|||
verify.applyCodeActionFromCompletion("1", {
|
||||
name: "fooBar",
|
||||
source: "/src/foo-bar",
|
||||
description: `Import 'fooBar' from module "./foo-bar".`,
|
||||
description: `Import 'fooBar' from module "./foo-bar"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import fooBar from "./foo-bar";\r
|
||||
\r
|
||||
|
|
|
@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a".`,
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import foo from "./a";\r
|
||||
\r
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "x",
|
||||
source: "m",
|
||||
description: `Import 'x' from module "m".`,
|
||||
description: `Import 'x' from module "m"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { x } from "m";\r
|
||||
\r
|
||||
|
|
|
@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/b" }, "const foo: 1", "",
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/b",
|
||||
description: `Import 'foo' from module "./b".`,
|
||||
description: `Import 'foo' from module "./b"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./b";\r
|
||||
\r
|
||||
|
|
|
@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Add 'foo' to existing import declaration from "./a".`,
|
||||
description: `Add 'foo' to existing import declaration from "./a"`,
|
||||
newFileContent: `import { x, foo } from "./a";
|
||||
f;`,
|
||||
});
|
||||
|
|
|
@ -17,7 +17,7 @@ verify.not.completionListContains({ name: "Test2", source: "/a" }, undefined, un
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "Test1",
|
||||
source: "/a",
|
||||
description: `Add 'Test1' to existing import declaration from "./a".`,
|
||||
description: `Add 'Test1' to existing import declaration from "./a"`,
|
||||
newFileContent: `import { Test2, Test1 } from "./a";
|
||||
t`,
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a".`,
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import * as a from "./a";
|
||||
import { foo } from "./a";\r
|
||||
|
|
|
@ -28,7 +28,7 @@ verify.not.completionListContains({ name: "foo", source: "/a_reexport_2" }, unde
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a".`,
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";\r
|
||||
\r
|
||||
|
|
|
@ -23,7 +23,7 @@ verify.not.completionListContains({ name: "foo", source: "/foo/index" }, undefin
|
|||
verify.applyCodeActionFromCompletion("", {
|
||||
name: "foo",
|
||||
source: "/foo/lib/foo",
|
||||
description: `Import 'foo' from module "./foo".`,
|
||||
description: `Import 'foo' from module "./foo"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./foo";\r
|
||||
\r
|
||||
|
|
|
@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
|
|||
verify.applyCodeActionFromCompletion("b", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a".`,
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";\r
|
||||
\r
|
||||
|
@ -39,7 +39,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
|
|||
verify.applyCodeActionFromCompletion("c", {
|
||||
name: "foo",
|
||||
source: "/a",
|
||||
description: `Import 'foo' from module "./a".`,
|
||||
description: `Import 'foo' from module "./a"`,
|
||||
// TODO: GH#18445
|
||||
newFileContent: `import { foo } from "./a";\r
|
||||
\r
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: `Remove declaration for: 'function1'.`,
|
||||
description: `Remove declaration for: 'function1'`,
|
||||
newFileContent: "class greeter {\n}",
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: `Remove declaration for: 'function1'.`,
|
||||
description: `Remove declaration for: 'function1'`,
|
||||
newFileContent: `class greeter {
|
||||
public function2() {
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: `Remove declaration for: 'function1'.`,
|
||||
description: `Remove declaration for: 'function1'`,
|
||||
newFileContent: "class greeter {\n}",
|
||||
});
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: `Remove declaration for: 'function1'.`,
|
||||
description: `Remove declaration for: 'function1'`,
|
||||
newRangeContent: `public function2(){
|
||||
}
|
||||
`,
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: `Remove declaration for: '"string"'.`,
|
||||
description: `Remove declaration for: '"string"'`,
|
||||
newFileContent: "class C {\n}",
|
||||
});
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: `Remove declaration for: '"string"'.`,
|
||||
description: `Remove declaration for: '"string"'`,
|
||||
newFileContent: "class C {\n}",
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'B'.",
|
||||
description: "Remove declaration for: 'B'",
|
||||
newFileContent: `namespace A {
|
||||
}`,
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'p1'.",
|
||||
description: "Remove declaration for: 'p1'",
|
||||
index: 0,
|
||||
newRangeContent: "constructor(public p2: boolean, public p3: any, p5)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Prefix 'p1' with an underscore.",
|
||||
description: "Prefix 'p1' with an underscore",
|
||||
index: 1,
|
||||
newRangeContent: "constructor(_p1: string, public p2: boolean, public p3: any, p5)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'p2'.",
|
||||
description: "Remove declaration for: 'p2'",
|
||||
index: 0,
|
||||
newRangeContent: "constructor(public p1: string, public p3: any, p5)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'p3'.",
|
||||
description: "Remove declaration for: 'p3'",
|
||||
index: 0,
|
||||
newRangeContent: "constructor(public p1: string, public p2: boolean, p5)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'p2'.",
|
||||
description: "Remove declaration for: 'p2'",
|
||||
index: 0,
|
||||
newRangeContent: "constructor(p5)",
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'x'.",
|
||||
description: "Remove declaration for: 'x'",
|
||||
index: 0,
|
||||
newRangeContent: "greeter()",
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Prefix 'x' with an underscore.",
|
||||
description: "Prefix 'x' with an underscore",
|
||||
index: 1,
|
||||
newRangeContent: "greeter( _x)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'y'.",
|
||||
description: "Remove declaration for: 'y'",
|
||||
index: 0,
|
||||
newRangeContent: "greeter(x)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'x'.",
|
||||
description: "Remove declaration for: 'x'",
|
||||
index: 0,
|
||||
newRangeContent: "greeter(y)",
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'y'.",
|
||||
description: "Remove declaration for: 'y'",
|
||||
index: 0,
|
||||
newRangeContent: "function greeter(x,z) ",
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'x'.",
|
||||
description: "Remove declaration for: 'x'",
|
||||
index: 0,
|
||||
newRangeContent: "return () => {}",
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Prefix 'x' with an underscore.",
|
||||
description: "Prefix 'x' with an underscore",
|
||||
index: 1,
|
||||
newRangeContent: "return (_x:number) => {}",
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'hw'.",
|
||||
description: "Remove declaration for: 'hw'",
|
||||
newFileContent: `namespace greeter {
|
||||
export type nw = "No" | "Way";
|
||||
}`,
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'T'.",
|
||||
description: "Remove declaration for: 'T'",
|
||||
newRangeContent: "class greeter ",
|
||||
});
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'Y'.",
|
||||
description: "Remove declaration for: 'Y'",
|
||||
newRangeContent: "class greeter<X> ",
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @noUnusedLocals: true
|
||||
|
@ -7,6 +8,6 @@
|
|||
////}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'Y'.",
|
||||
description: "Remove declaration for: 'Y'",
|
||||
newRangeContent: "class greeter<X, Z> ",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
//// [|function f1<T>() {}|]
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'T'.",
|
||||
description: "Remove declaration for: 'T'",
|
||||
newRangeContent: "function f1() {}",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
//// [|function f1<X, Y>(a: X) {a}|]
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'Y'.",
|
||||
description: "Remove declaration for: 'Y'",
|
||||
newRangeContent: "function f1<X>(a: X) {a}",
|
||||
});
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
//// [|function f1<X, Y, Z>(a: X) {a;var b:Z;b}|]
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'Y'.",
|
||||
description: "Remove declaration for: 'Y'",
|
||||
newRangeContent: "function f1<X, Z>(a: X) {a;var b:Z;b}",
|
||||
});
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
//// [|interface I<T> {}|]
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'T'.",
|
||||
description: "Remove declaration for: 'T'",
|
||||
newRangeContent: "interface I {}",
|
||||
});
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'T'.",
|
||||
description: "Remove declaration for: 'T'",
|
||||
newRangeContent: "return(x:number) => {x}",
|
||||
});
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'U'.",
|
||||
description: "Remove declaration for: 'U'",
|
||||
newRangeContent: "new <T>(a: T): void;",
|
||||
});
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'K'.",
|
||||
description: "Remove declaration for: 'K'",
|
||||
newRangeContent: "new <T, U>(a: T): A<U>;",
|
||||
});
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
//// [|var y: new <T,U>(a:T)=>void;|]
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'U'.",
|
||||
description: "Remove declaration for: 'U'",
|
||||
newRangeContent: "var y: new <T>(a:T)=>void;",
|
||||
});
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'T'.",
|
||||
description: "Remove declaration for: 'T'",
|
||||
newRangeContent: "f1()",
|
||||
});
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'T'.",
|
||||
description: "Remove declaration for: 'T'",
|
||||
newRangeContent: "f1<U>(a: U)",
|
||||
});
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
//// }
|
||||
|
||||
verify.codeFix({
|
||||
description: "Remove declaration for: 'Y'.",
|
||||
description: "Remove declaration for: 'Y'",
|
||||
newRangeContent: "public f1<X, Z>(a: X)",
|
||||
});
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue