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:
Mohamed Hegazy 2017-12-01 16:38:59 -08:00 committed by GitHub
parent 8d7c2a2a77
commit 65af685b49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
119 changed files with 163 additions and 162 deletions

View file

@ -2272,6 +2272,10 @@
"category": "Error", "category": "Error",
"code": 2718 "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}'.": { "Import declaration '{0}' is using private name '{1}'.": {
"category": "Error", "category": "Error",
@ -2719,6 +2723,11 @@
"category": "Error", "category": "Error",
"code": 5067 "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.": { "Concatenate and emit output to single file.": {
"category": "Message", "category": "Message",
"code": 6001 "code": 6001
@ -3710,7 +3719,7 @@
}, },
"JSX fragment is not supported when using --jsxFactory": { "JSX fragment is not supported when using --jsxFactory": {
"category": "Error", "category": "Error",
"code":17016 "code": 17016
}, },
"Circularity detected while resolving configuration: {0}": { "Circularity detected while resolving configuration: {0}": {
@ -3730,104 +3739,95 @@
"code": 18003 "code": 18003
}, },
"Add missing 'super()' call.": { "Add missing 'super()' call": {
"category": "Message", "category": "Message",
"code": 90001 "code": 90001
}, },
"Make 'super()' call the first statement in the constructor.": { "Make 'super()' call the first statement in the constructor": {
"category": "Message", "category": "Message",
"code": 90002 "code": 90002
}, },
"Change 'extends' to 'implements'.": { "Change 'extends' to 'implements'": {
"category": "Message", "category": "Message",
"code": 90003 "code": 90003
}, },
"Remove declaration for: '{0}'.": { "Remove declaration for: '{0}'": {
"category": "Message", "category": "Message",
"code": 90004 "code": 90004
}, },
"Implement interface '{0}'.": { "Implement interface '{0}'": {
"category": "Message", "category": "Message",
"code": 90006 "code": 90006
}, },
"Implement inherited abstract class.": { "Implement inherited abstract class": {
"category": "Message", "category": "Message",
"code": 90007 "code": 90007
}, },
"Add 'this.' to unresolved variable.": { "Add 'this.' to unresolved variable": {
"category": "Message", "category": "Message",
"code": 90008 "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.": { "Import '{0}' from module \"{1}\"": {
"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}\".": {
"category": "Message", "category": "Message",
"code": 90013 "code": 90013
}, },
"Change '{0}' to '{1}'.": { "Change '{0}' to '{1}'": {
"category": "Message", "category": "Message",
"code": 90014 "code": 90014
}, },
"Add '{0}' to existing import declaration from \"{1}\".": { "Add '{0}' to existing import declaration from \"{1}\"": {
"category": "Message", "category": "Message",
"code": 90015 "code": 90015
}, },
"Declare property '{0}'.": { "Declare property '{0}'": {
"category": "Message", "category": "Message",
"code": 90016 "code": 90016
}, },
"Add index signature for property '{0}'.": { "Add index signature for property '{0}'": {
"category": "Message", "category": "Message",
"code": 90017 "code": 90017
}, },
"Disable checking for this file": {
"Disable checking for this file.": {
"category": "Message", "category": "Message",
"code": 90018 "code": 90018
}, },
"Ignore this error message.": { "Ignore this error message": {
"category": "Message", "category": "Message",
"code": 90019 "code": 90019
}, },
"Initialize property '{0}' in the constructor.": { "Initialize property '{0}' in the constructor": {
"category": "Message", "category": "Message",
"code": 90020 "code": 90020
}, },
"Initialize static property '{0}'.": { "Initialize static property '{0}'": {
"category": "Message", "category": "Message",
"code": 90021 "code": 90021
}, },
"Change spelling to '{0}'.": { "Change spelling to '{0}'": {
"category": "Message", "category": "Message",
"code": 90022 "code": 90022
}, },
"Declare method '{0}'.": { "Declare method '{0}'": {
"category": "Message", "category": "Message",
"code": 90023 "code": 90023
}, },
"Declare static method '{0}'.": { "Declare static method '{0}'": {
"category": "Message", "category": "Message",
"code": 90024 "code": 90024
}, },
"Prefix '{0}' with an underscore.": { "Prefix '{0}' with an underscore": {
"category": "Message", "category": "Message",
"code": 90025 "code": 90025
}, },
"Rewrite as the indexed access type '{0}'.": { "Rewrite as the indexed access type '{0}'": {
"category": "Message", "category": "Message",
"code": 90026 "code": 90026
}, },
"Declare static property '{0}'.": { "Declare static property '{0}'": {
"category": "Message", "category": "Message",
"code": 90027 "code": 90027
}, },
"Call decorator expression.": { "Call decorator expression": {
"category": "Message", "category": "Message",
"code": 90028 "code": 90028
}, },
@ -3871,11 +3871,11 @@
"category": "Message", "category": "Message",
"code": 95010 "code": 95010
}, },
"Infer type of '{0}' from usage.": { "Infer type of '{0}' from usage": {
"category": "Message", "category": "Message",
"code": 95011 "code": 95011
}, },
"Infer parameter types from usage.": { "Infer parameter types from usage": {
"category": "Message", "category": "Message",
"code": 95012 "code": 95012
}, },

View file

@ -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) ==== ==== tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts (1 errors) ====
@ -9,7 +9,7 @@ tests/cases/compiler/incompatibleAssignmentOfIdenticallyNamedTypes.ts(6,9): erro
fn() { fn() {
this.x = a; 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.
} }
} }

View file

@ -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'. Types have separate declarations of a private property 'x'.
@ -13,8 +13,8 @@
// Should fail. We no longer resolve any symlinks. // Should fail. We no longer resolve any symlinks.
x = new C2(); 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 TS2719: 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: Types have separate declarations of a private property 'x'.
==== /linked/index.d.ts (0 errors) ==== ==== /linked/index.d.ts (0 errors) ====
export { real } from "real"; export { real } from "real";

View file

@ -9,6 +9,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Call decorator expression.", description: "Call decorator expression",
newRangeContent: `@foo()` newRangeContent: `@foo()`
}); });

View file

@ -8,7 +8,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Add 'this.' to unresolved variable.", description: "Add 'this.' to unresolved variable",
newRangeContent: ` newRangeContent: `
this.foo = 10; this.foo = 10;
` `

View file

@ -7,6 +7,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Add 'this.' to unresolved variable.", description: "Add 'this.' to unresolved variable",
newRangeContent: "this.foo = 10", newRangeContent: "this.foo = 10",
}); });

View file

@ -7,7 +7,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Declare property 'foo'.", description: "Declare property 'foo'",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -7,7 +7,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Add index signature for property 'foo'.", description: "Add index signature for property 'foo'",
index: 1, index: 1,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -7,7 +7,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Declare static property 'foo'.", description: "Declare static property 'foo'",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -13,7 +13,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Initialize property 'foo' in the constructor.", description: "Initialize property 'foo' in the constructor",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -11,7 +11,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Initialize static property 'foo'.", description: "Initialize static property 'foo'",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -11,7 +11,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Initialize property 'foo' in the constructor.", description: "Initialize property 'foo' in the constructor",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -9,7 +9,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Initialize static property 'foo'.", description: "Initialize static property 'foo'",
index: 2, index: 2,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `class C { newFileContent: `class C {

View file

@ -4,6 +4,6 @@
//// [|/* */ class /* */ C /* */ extends /* */ I|]{} //// [|/* */ class /* */ C /* */ extends /* */ I|]{}
verify.codeFix({ verify.codeFix({
description: "Change 'extends' to 'implements'.", description: "Change 'extends' to 'implements'",
newRangeContent: "/* */ class /* */ C /* */ implements /* */ I", newRangeContent: "/* */ class /* */ C /* */ implements /* */ I",
}); });

View file

@ -6,7 +6,7 @@
//// [|abstract class A extends I1 implements I2|] { } //// [|abstract class A extends I1 implements I2|] { }
verify.codeFix({ verify.codeFix({
description: "Change 'extends' to 'implements'.", description: "Change 'extends' to 'implements'",
// TODO: GH#18794 // TODO: GH#18794
newRangeContent: "abstract class A implements I1 , I2", newRangeContent: "abstract class A implements I1 , I2",
}); });

View file

@ -4,6 +4,6 @@
////[|class C<T extends string , U> extends I<T>|]{} ////[|class C<T extends string , U> extends I<T>|]{}
verify.codeFix({ verify.codeFix({
description: "Change 'extends' to 'implements'.", description: "Change 'extends' to 'implements'",
newRangeContent: "class C<T extends string , U> implements I<T>", newRangeContent: "class C<T extends string , U> implements I<T>",
}); });

View file

@ -11,7 +11,7 @@
//// @sealed //// @sealed
//// [|class A extends I1 implements I2 { }|] //// [|class A extends I1 implements I2 { }|]
verify.codeFix({ verify.codeFix({
description: "Change 'extends' to 'implements'.", description: "Change 'extends' to 'implements'",
// TODO: GH#18794 // TODO: GH#18794
newRangeContent: "class A implements I1 , I2 { }", newRangeContent: "class A implements I1 , I2 { }",
}); });

View file

@ -2,6 +2,6 @@
//// var x: [|?|] = 12; //// var x: [|?|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change '?' to 'any'.", description: "Change '?' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -4,7 +4,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Change 'number?' to 'number | null'.", description: "Change 'number?' to 'number | null'",
errorCode: 8020, errorCode: 8020,
index: 0, index: 0,
newRangeContent: "number | null", newRangeContent: "number | null",

View file

@ -4,7 +4,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Change 'string?' to 'string | null | undefined'.", description: "Change 'string?' to 'string | null | undefined'",
errorCode: 8020, errorCode: 8020,
index: 1, index: 1,
newRangeContent: "string | null | undefined", newRangeContent: "string | null | undefined",

View file

@ -5,7 +5,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
errorCode: 8020, errorCode: 8020,
index: 0, index: 0,
newRangeContent: "any", newRangeContent: "any",

View file

@ -5,7 +5,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
errorCode: 8020, errorCode: 8020,
index: 0, index: 0,
newRangeContent: "any", newRangeContent: "any",

View file

@ -3,7 +3,7 @@
//// var x = 12 as [|number?|]; //// var x = 12 as [|number?|];
verify.codeFix({ verify.codeFix({
description: "Change 'number?' to 'number | null'.", description: "Change 'number?' to 'number | null'",
errorCode: 8020, errorCode: 8020,
index: 0, index: 0,
newRangeContent: "number | null", newRangeContent: "number | null",

View file

@ -3,7 +3,7 @@
// note: without --strict, number? --> number, not number | null // note: without --strict, number? --> number, not number | null
verify.codeFix({ verify.codeFix({
description: "Change 'function(number?): number' to '(arg0: number) => number'.", description: "Change 'function(number?): number' to '(arg0: number) => number'",
errorCode: 8020, errorCode: 8020,
index: 0, index: 0,
newRangeContent: "(arg0: number) => number", newRangeContent: "(arg0: number) => number",

View file

@ -2,6 +2,6 @@
//// var f: { [K in keyof number]: [|*|] }; //// var f: { [K in keyof number]: [|*|] };
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// declare function index(ix: number): [|*|]; //// declare function index(ix: number): [|*|];
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var index: { (ix: number): [|?|] }; //// var index: { (ix: number): [|?|] };
verify.codeFix({ verify.codeFix({
description: "Change '?' to 'any'.", description: "Change '?' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var index: { new (ix: number): [|?|] }; //// var index: { new (ix: number): [|?|] };
verify.codeFix({ verify.codeFix({
description: "Change '?' to 'any'.", description: "Change '?' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var x: [|*|] = 12; //// var x: [|*|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var index = { get p(): [|*|] { return 12 } }; //// var index = { get p(): [|*|] { return 12 } };
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var index = { set p(x: [|*|]) { } }; //// var index = { set p(x: [|*|]) { } };
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var index: { [s: string]: [|*|] }; //// var index: { [s: string]: [|*|] };
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -5,6 +5,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -4,6 +4,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -4,6 +4,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -4,6 +4,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Change '*' to 'any'.", description: "Change '*' to 'any'",
newRangeContent: "any", newRangeContent: "any",
}); });

View file

@ -2,6 +2,6 @@
//// var x: [|Array.<number>|] = 12; //// var x: [|Array.<number>|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change 'Array.<number>' to 'number[]'.", description: "Change 'Array.<number>' to 'number[]'",
newRangeContent: "number[]", newRangeContent: "number[]",
}); });

View file

@ -3,7 +3,7 @@
//// var x: [|?number|] = 12; //// var x: [|?number|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change '?number' to 'number | null'.", description: "Change '?number' to 'number | null'",
errorCode: 8020, errorCode: 8020,
index: 0, index: 0,
newRangeContent: "number | null", newRangeContent: "number | null",

View file

@ -3,7 +3,7 @@
//// var x: [|number?|] = 12; //// var x: [|number?|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change 'number?' to 'number | null | undefined'.", description: "Change 'number?' to 'number | null | undefined'",
index: 1, index: 1,
newRangeContent: "number | null | undefined", newRangeContent: "number | null | undefined",
}); });

View file

@ -2,6 +2,6 @@
//// var x: [|!number|] = 12; //// var x: [|!number|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change '!number' to 'number'.", description: "Change '!number' to 'number'",
newRangeContent: "number", newRangeContent: "number",
}); });

View file

@ -2,6 +2,6 @@
//// var x: [|function(this: number, number): string|] = 12; //// var x: [|function(this: number, number): string|] = 12;
verify.codeFix({ 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", newRangeContent: "(this: number, arg1: number) => string",
}); });

View file

@ -2,6 +2,6 @@
//// var x: [|function(new: number)|] = 12; //// var x: [|function(new: number)|] = 12;
verify.codeFix({ verify.codeFix({
description: "Change 'function(new: number)' to 'new () => number'.", description: "Change 'function(new: number)' to 'new () => number'",
newRangeContent: "new () => number", newRangeContent: "new () => number",
}); });

View file

@ -7,7 +7,7 @@
////let B = class implements A {[| |]} ////let B = class implements A {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement interface 'A'.", description: "Implement interface 'A'",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `f(): void {\r newRangeContent: `f(): void {\r
throw new Error("Method not implemented.");\r throw new Error("Method not implemented.");\r

View file

@ -10,7 +10,7 @@
////let B = class extends foo("s")<number> {[| |]} ////let B = class extends foo("s")<number> {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `a: string | number;\r newRangeContent: `a: string | number;\r
` `

View file

@ -10,7 +10,7 @@
////class B extends foo("s")<number> {[| |]} ////class B extends foo("s")<number> {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `a: string | number;\r newRangeContent: `a: string | number;\r
` `

View file

@ -21,7 +21,7 @@
////class C extends A {[| |]} ////class C extends A {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `a: string | number;\r newRangeContent: `a: string | number;\r
b: this;\r b: this;\r

View file

@ -11,7 +11,7 @@
////class C extends A {[| |]} ////class C extends A {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `f(a: number, b: string): boolean;\r newRangeContent: `f(a: number, b: string): boolean;\r
f(a: number, b: string): this;\r f(a: number, b: string): this;\r

View file

@ -7,7 +7,7 @@
////class C extends A {[| |]} ////class C extends A {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `f(): this {\r newRangeContent: `f(): this {\r
throw new Error("Method not implemented.");\r throw new Error("Method not implemented.");\r

View file

@ -7,7 +7,7 @@
////class C extends A<number> {[| |]} ////class C extends A<number> {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `f(x: number): number {\r newRangeContent: `f(x: number): number {\r
throw new Error("Method not implemented.");\r throw new Error("Method not implemented.");\r

View file

@ -7,7 +7,7 @@
////class C<U> extends A<U> {[| |]} ////class C<U> extends A<U> {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `f(x: U): U {\r newRangeContent: `f(x: U): U {\r
throw new Error("Method not implemented.");\r throw new Error("Method not implemented.");\r

View file

@ -9,7 +9,7 @@
////class C extends A {[| |]} ////class C extends A {[| |]}
verify.codeFix({ verify.codeFix({
description: "Implement inherited abstract class.", description: "Implement inherited abstract class",
// TODO: GH#18795 // TODO: GH#18795
newRangeContent: `x: number;\r newRangeContent: `x: number;\r
y: this;\r y: this;\r

View file

@ -10,7 +10,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Declare static method 'm1'.", description: "Declare static method 'm1'",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newRangeContent: ` newRangeContent: `
@ -21,7 +21,7 @@ verify.codeFix({
}); });
verify.codeFix({ verify.codeFix({
description: "Declare static method 'm2'.", description: "Declare static method 'm2'",
index: 0, index: 0,
newRangeContent: ` newRangeContent: `
static m2(arg0: any, arg1: any): any {\r static m2(arg0: any, arg1: any): any {\r
@ -34,7 +34,7 @@ verify.codeFix({
}); });
verify.codeFix({ verify.codeFix({
description: "Declare static property 'prop1'.", description: "Declare static property 'prop1'",
index: 0, index: 0,
newRangeContent: ` newRangeContent: `
static prop1: number;\r static prop1: number;\r
@ -48,7 +48,7 @@ verify.codeFix({
}); });
verify.codeFix({ verify.codeFix({
description: "Declare static property 'prop2'.", description: "Declare static property 'prop2'",
index: 0, index: 0,
newRangeContent: ` newRangeContent: `
static prop2: string;\r static prop2: string;\r

View file

@ -11,7 +11,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Declare method 'foo1'.", description: "Declare method 'foo1'",
index: 0, index: 0,
// TODO: GH#18445 // TODO: GH#18445
newRangeContent: ` newRangeContent: `
@ -22,7 +22,7 @@ verify.codeFix({
}); });
verify.codeFix({ verify.codeFix({
description: "Declare method 'foo2'.", description: "Declare method 'foo2'",
index: 0, index: 0,
newRangeContent: ` newRangeContent: `
foo2<T, U, V, W, X, Y, Z>(): any {\r foo2<T, U, V, W, X, Y, Z>(): any {\r
@ -35,7 +35,7 @@ verify.codeFix({
}); });
verify.codeFix({ verify.codeFix({
description: "Declare method 'foo3'.", description: "Declare method 'foo3'",
index: 0, index: 0,
newRangeContent:` newRangeContent:`
foo3<T0, T1, T2, T3, T4, T5, T6, T7>(): any {\r foo3<T0, T1, T2, T3, T4, T5, T6, T7>(): any {\r

View file

@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", 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"; newFileContent: `import foo, { x } from "./a";
f;`, f;`,
}); });

View file

@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", 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"; newFileContent: `import foo, * as a from "./a";
f;`, f;`,
}); });

View file

@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", source: "/a",
description: `Import 'foo' from module "./a".`, description: `Import 'foo' from module "./a"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import f_o_o from "./a"; newFileContent: `import f_o_o from "./a";
import foo from "./a";\r import foo from "./a";\r

View file

@ -21,7 +21,7 @@ verify.completionListContains({ name: "fooBar", source: "/src/foo-bar" }, "(prop
verify.applyCodeActionFromCompletion("1", { verify.applyCodeActionFromCompletion("1", {
name: "fooBar", name: "fooBar",
source: "/src/foo-bar", source: "/src/foo-bar",
description: `Import 'fooBar' from module "./foo-bar".`, description: `Import 'fooBar' from module "./foo-bar"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import fooBar from "./foo-bar";\r newFileContent: `import fooBar from "./foo-bar";\r
\r \r

View file

@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", source: "/a",
description: `Import 'foo' from module "./a".`, description: `Import 'foo' from module "./a"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import foo from "./a";\r newFileContent: `import foo from "./a";\r
\r \r

View file

@ -11,7 +11,7 @@
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "x", name: "x",
source: "m", source: "m",
description: `Import 'x' from module "m".`, description: `Import 'x' from module "m"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import { x } from "m";\r newFileContent: `import { x } from "m";\r
\r \r

View file

@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/b" }, "const foo: 1", "",
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/b", source: "/b",
description: `Import 'foo' from module "./b".`, description: `Import 'foo' from module "./b"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import { foo } from "./b";\r newFileContent: `import { foo } from "./b";\r
\r \r

View file

@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", 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"; newFileContent: `import { x, foo } from "./a";
f;`, f;`,
}); });

View file

@ -17,7 +17,7 @@ verify.not.completionListContains({ name: "Test2", source: "/a" }, undefined, un
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "Test1", name: "Test1",
source: "/a", 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"; newFileContent: `import { Test2, Test1 } from "./a";
t`, t`,
}); });

View file

@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", source: "/a",
description: `Import 'foo' from module "./a".`, description: `Import 'foo' from module "./a"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import * as a from "./a"; newFileContent: `import * as a from "./a";
import { foo } from "./a";\r import { foo } from "./a";\r

View file

@ -28,7 +28,7 @@ verify.not.completionListContains({ name: "foo", source: "/a_reexport_2" }, unde
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/a", source: "/a",
description: `Import 'foo' from module "./a".`, description: `Import 'foo' from module "./a"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import { foo } from "./a";\r newFileContent: `import { foo } from "./a";\r
\r \r

View file

@ -23,7 +23,7 @@ verify.not.completionListContains({ name: "foo", source: "/foo/index" }, undefin
verify.applyCodeActionFromCompletion("", { verify.applyCodeActionFromCompletion("", {
name: "foo", name: "foo",
source: "/foo/lib/foo", source: "/foo/lib/foo",
description: `Import 'foo' from module "./foo".`, description: `Import 'foo' from module "./foo"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import { foo } from "./foo";\r newFileContent: `import { foo } from "./foo";\r
\r \r

View file

@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
verify.applyCodeActionFromCompletion("b", { verify.applyCodeActionFromCompletion("b", {
name: "foo", name: "foo",
source: "/a", source: "/a",
description: `Import 'foo' from module "./a".`, description: `Import 'foo' from module "./a"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import { foo } from "./a";\r newFileContent: `import { foo } from "./a";\r
\r \r
@ -39,7 +39,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
verify.applyCodeActionFromCompletion("c", { verify.applyCodeActionFromCompletion("c", {
name: "foo", name: "foo",
source: "/a", source: "/a",
description: `Import 'foo' from module "./a".`, description: `Import 'foo' from module "./a"`,
// TODO: GH#18445 // TODO: GH#18445
newFileContent: `import { foo } from "./a";\r newFileContent: `import { foo } from "./a";\r
\r \r

View file

@ -7,6 +7,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: `Remove declaration for: 'function1'.`, description: `Remove declaration for: 'function1'`,
newFileContent: "class greeter {\n}", newFileContent: "class greeter {\n}",
}); });

View file

@ -9,7 +9,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: `Remove declaration for: 'function1'.`, description: `Remove declaration for: 'function1'`,
newFileContent: `class greeter { newFileContent: `class greeter {
public function2() { public function2() {
} }

View file

@ -7,6 +7,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: `Remove declaration for: 'function1'.`, description: `Remove declaration for: 'function1'`,
newFileContent: "class greeter {\n}", newFileContent: "class greeter {\n}",
}); });

View file

@ -9,7 +9,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: `Remove declaration for: 'function1'.`, description: `Remove declaration for: 'function1'`,
newRangeContent: `public function2(){ newRangeContent: `public function2(){
} }
`, `,

View file

@ -6,6 +6,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: `Remove declaration for: '"string"'.`, description: `Remove declaration for: '"string"'`,
newFileContent: "class C {\n}", newFileContent: "class C {\n}",
}); });

View file

@ -6,6 +6,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: `Remove declaration for: '"string"'.`, description: `Remove declaration for: '"string"'`,
newFileContent: "class C {\n}", newFileContent: "class C {\n}",
}); });

View file

@ -7,7 +7,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'B'.", description: "Remove declaration for: 'B'",
newFileContent: `namespace A { newFileContent: `namespace A {
}`, }`,
}); });

View file

@ -6,7 +6,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'p1'.", description: "Remove declaration for: 'p1'",
index: 0, index: 0,
newRangeContent: "constructor(public p2: boolean, public p3: any, p5)", newRangeContent: "constructor(public p2: boolean, public p3: any, p5)",
}); });

View file

@ -6,7 +6,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Prefix 'p1' with an underscore.", description: "Prefix 'p1' with an underscore",
index: 1, index: 1,
newRangeContent: "constructor(_p1: string, public p2: boolean, public p3: any, p5)", newRangeContent: "constructor(_p1: string, public p2: boolean, public p3: any, p5)",
}); });

View file

@ -6,7 +6,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'p2'.", description: "Remove declaration for: 'p2'",
index: 0, index: 0,
newRangeContent: "constructor(public p1: string, public p3: any, p5)", newRangeContent: "constructor(public p1: string, public p3: any, p5)",
}); });

View file

@ -6,7 +6,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'p3'.", description: "Remove declaration for: 'p3'",
index: 0, index: 0,
newRangeContent: "constructor(public p1: string, public p2: boolean, p5)", newRangeContent: "constructor(public p1: string, public p2: boolean, p5)",
}); });

View file

@ -6,7 +6,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'p2'.", description: "Remove declaration for: 'p2'",
index: 0, index: 0,
newRangeContent: "constructor(p5)", newRangeContent: "constructor(p5)",
}); });

View file

@ -5,7 +5,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'x'.", description: "Remove declaration for: 'x'",
index: 0, index: 0,
newRangeContent: "greeter()", newRangeContent: "greeter()",
}); });

View file

@ -5,7 +5,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Prefix 'x' with an underscore.", description: "Prefix 'x' with an underscore",
index: 1, index: 1,
newRangeContent: "greeter( _x)", newRangeContent: "greeter( _x)",
}); });

View file

@ -6,7 +6,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'y'.", description: "Remove declaration for: 'y'",
index: 0, index: 0,
newRangeContent: "greeter(x)", newRangeContent: "greeter(x)",
}); });

View file

@ -6,7 +6,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'x'.", description: "Remove declaration for: 'x'",
index: 0, index: 0,
newRangeContent: "greeter(y)", newRangeContent: "greeter(y)",
}); });

View file

@ -6,7 +6,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'y'.", description: "Remove declaration for: 'y'",
index: 0, index: 0,
newRangeContent: "function greeter(x,z) ", newRangeContent: "function greeter(x,z) ",
}); });

View file

@ -7,7 +7,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'x'.", description: "Remove declaration for: 'x'",
index: 0, index: 0,
newRangeContent: "return () => {}", newRangeContent: "return () => {}",
}); });

View file

@ -7,7 +7,7 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Prefix 'x' with an underscore.", description: "Prefix 'x' with an underscore",
index: 1, index: 1,
newRangeContent: "return (_x:number) => {}", newRangeContent: "return (_x:number) => {}",
}); });

View file

@ -7,7 +7,7 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'hw'.", description: "Remove declaration for: 'hw'",
newFileContent: `namespace greeter { newFileContent: `namespace greeter {
export type nw = "No" | "Way"; export type nw = "No" | "Way";
}`, }`,

View file

@ -5,6 +5,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'T'.", description: "Remove declaration for: 'T'",
newRangeContent: "class greeter ", newRangeContent: "class greeter ",
}); });

View file

@ -6,6 +6,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'Y'.", description: "Remove declaration for: 'Y'",
newRangeContent: "class greeter<X> ", newRangeContent: "class greeter<X> ",
}); });

View file

@ -1,3 +1,4 @@
/// <reference path='fourslash.ts' /> /// <reference path='fourslash.ts' />
// @noUnusedLocals: true // @noUnusedLocals: true
@ -7,6 +8,6 @@
////} ////}
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'Y'.", description: "Remove declaration for: 'Y'",
newRangeContent: "class greeter<X, Z> ", newRangeContent: "class greeter<X, Z> ",
}); });

View file

@ -4,6 +4,6 @@
//// [|function f1<T>() {}|] //// [|function f1<T>() {}|]
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'T'.", description: "Remove declaration for: 'T'",
newRangeContent: "function f1() {}", newRangeContent: "function f1() {}",
}); });

View file

@ -4,6 +4,6 @@
//// [|function f1<X, Y>(a: X) {a}|] //// [|function f1<X, Y>(a: X) {a}|]
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'Y'.", description: "Remove declaration for: 'Y'",
newRangeContent: "function f1<X>(a: X) {a}", newRangeContent: "function f1<X>(a: X) {a}",
}); });

View file

@ -4,6 +4,6 @@
//// [|function f1<X, Y, Z>(a: X) {a;var b:Z;b}|] //// [|function f1<X, Y, Z>(a: X) {a;var b:Z;b}|]
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'Y'.", description: "Remove declaration for: 'Y'",
newRangeContent: "function f1<X, Z>(a: X) {a;var b:Z;b}", newRangeContent: "function f1<X, Z>(a: X) {a;var b:Z;b}",
}); });

View file

@ -5,6 +5,6 @@
//// [|interface I<T> {}|] //// [|interface I<T> {}|]
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'T'.", description: "Remove declaration for: 'T'",
newRangeContent: "interface I {}", newRangeContent: "interface I {}",
}); });

View file

@ -7,6 +7,6 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'T'.", description: "Remove declaration for: 'T'",
newRangeContent: "return(x:number) => {x}", newRangeContent: "return(x:number) => {x}",
}); });

View file

@ -7,6 +7,6 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'U'.", description: "Remove declaration for: 'U'",
newRangeContent: "new <T>(a: T): void;", newRangeContent: "new <T>(a: T): void;",
}); });

View file

@ -8,6 +8,6 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'K'.", description: "Remove declaration for: 'K'",
newRangeContent: "new <T, U>(a: T): A<U>;", newRangeContent: "new <T, U>(a: T): A<U>;",
}); });

View file

@ -7,6 +7,6 @@
//// [|var y: new <T,U>(a:T)=>void;|] //// [|var y: new <T,U>(a:T)=>void;|]
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'U'.", description: "Remove declaration for: 'U'",
newRangeContent: "var y: new <T>(a:T)=>void;", newRangeContent: "var y: new <T>(a:T)=>void;",
}); });

View file

@ -6,6 +6,6 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'T'.", description: "Remove declaration for: 'T'",
newRangeContent: "f1()", newRangeContent: "f1()",
}); });

View file

@ -6,6 +6,6 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'T'.", description: "Remove declaration for: 'T'",
newRangeContent: "f1<U>(a: U)", newRangeContent: "f1<U>(a: U)",
}); });

View file

@ -6,6 +6,6 @@
//// } //// }
verify.codeFix({ verify.codeFix({
description: "Remove declaration for: 'Y'.", description: "Remove declaration for: 'Y'",
newRangeContent: "public f1<X, Z>(a: X)", newRangeContent: "public f1<X, Z>(a: X)",
}); });

Some files were not shown because too many files have changed in this diff Show more