683b3ec058
* feat(37782): add quick-fix action to declare a private method for names that start from underscore * better merge order in messages json Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
30 lines
687 B
TypeScript
30 lines
687 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
////class A {
|
|
//// constructor() {
|
|
//// this._foo();
|
|
//// }
|
|
////}
|
|
|
|
verify.codeFixAvailable([
|
|
{ description: "Declare private method '_foo'" },
|
|
{ description: "Declare method '_foo'" },
|
|
{ description: "Declare private property '_foo'" },
|
|
{ description: "Declare property '_foo'" },
|
|
{ description: "Add index signature for property '_foo'" }
|
|
])
|
|
|
|
verify.codeFix({
|
|
description: [ts.Diagnostics.Declare_private_method_0.message, "_foo"],
|
|
index: 0,
|
|
newFileContent:
|
|
`class A {
|
|
constructor() {
|
|
this._foo();
|
|
}
|
|
private _foo() {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
}`
|
|
});
|