From f9123aa5cc7a748299877db134da383949d0dd1e Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 1 Jun 2017 11:01:00 -0700 Subject: [PATCH] rename fourslash method --- src/harness/fourslash.ts | 2 +- tests/cases/fourslash/codeFixAddMissingMember5.ts | 2 +- tests/cases/fourslash/codeFixAddMissingMember7.ts | 2 +- tests/cases/fourslash/codeFixUndeclaredAcrossFiles1.ts | 8 ++++---- tests/cases/fourslash/codeFixUndeclaredAcrossFiles2.ts | 8 ++++---- tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts | 8 ++++---- tests/cases/fourslash/codeFixUndeclaredMethod.ts | 6 +++--- tests/cases/fourslash/fourslash.ts | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 0cbf98cebf7..f1146919e49 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -3816,7 +3816,7 @@ namespace FourSlashInterface { this.state.verifyRangeIs(expectedText, includeWhiteSpace); } - public applyCodeFix(errorCode?: number, index?: number): void { + public getAndApplyCodeFix(errorCode?: number, index?: number): void { this.state.getAndApplyCodeActions(errorCode, index); } diff --git a/tests/cases/fourslash/codeFixAddMissingMember5.ts b/tests/cases/fourslash/codeFixAddMissingMember5.ts index 53d47e9a8d3..db893cb61d3 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember5.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember5.ts @@ -11,7 +11,7 @@ ////} ////|] -verify.applyCodeFix(/*errorCode*/ undefined, /*index*/ 0); +verify.getAndApplyCodeFix(/*errorCode*/ undefined, /*index*/ 0); verify.currentFileContentIs(`class C { static method() { ()=>{ this.foo === 10 }; diff --git a/tests/cases/fourslash/codeFixAddMissingMember7.ts b/tests/cases/fourslash/codeFixAddMissingMember7.ts index 04c3efc86b8..8ac7f2b5aff 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember7.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember7.ts @@ -9,7 +9,7 @@ ////} ////|] -verify.applyCodeFix(/*errorCode*/ undefined, /*index*/ 2) +verify.getAndApplyCodeFix(/*errorCode*/ undefined, /*index*/ 2) verify.currentFileContentIs(`class C { static p = ()=>{ this.foo === 10 }; } diff --git a/tests/cases/fourslash/codeFixUndeclaredAcrossFiles1.ts b/tests/cases/fourslash/codeFixUndeclaredAcrossFiles1.ts index 830259e3ca7..435b78ba3fa 100644 --- a/tests/cases/fourslash/codeFixUndeclaredAcrossFiles1.ts +++ b/tests/cases/fourslash/codeFixUndeclaredAcrossFiles1.ts @@ -17,10 +17,10 @@ //// static y: string; //// } -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); verify.rangeIs(` y: { [x: string]: any; }; diff --git a/tests/cases/fourslash/codeFixUndeclaredAcrossFiles2.ts b/tests/cases/fourslash/codeFixUndeclaredAcrossFiles2.ts index 6064ee5ae30..9f40c967658 100644 --- a/tests/cases/fourslash/codeFixUndeclaredAcrossFiles2.ts +++ b/tests/cases/fourslash/codeFixUndeclaredAcrossFiles2.ts @@ -18,10 +18,10 @@ //// constructor() { } //// }|] -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); verify.rangeIs(` export class C { diff --git a/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts b/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts index 94ad3f77615..0669a9ee462 100644 --- a/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts +++ b/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts @@ -9,10 +9,10 @@ //// } //// } -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); verify.rangeIs(` static prop2: string; diff --git a/tests/cases/fourslash/codeFixUndeclaredMethod.ts b/tests/cases/fourslash/codeFixUndeclaredMethod.ts index 1f842a5bcf1..6a61f8421aa 100644 --- a/tests/cases/fourslash/codeFixUndeclaredMethod.ts +++ b/tests/cases/fourslash/codeFixUndeclaredMethod.ts @@ -10,9 +10,9 @@ //// } //// } -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); -verify.applyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); +verify.getAndApplyCodeFix(/*errorCode*/undefined, 0); verify.rangeIs(` foo3(): any { diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index b0f731dcdea..3e80b005625 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -237,7 +237,7 @@ declare namespace FourSlashInterface { DocCommentTemplate(expectedText: string, expectedOffset: number, empty?: boolean): void; noDocCommentTemplate(): void; rangeAfterCodeFix(expectedText: string, includeWhiteSpace?: boolean, errorCode?: number, index?: number): void - applyCodeFix(errorCode?: number, index?: number): void; + getAndApplyCodeFix(errorCode?: number, index?: number): void; rangeIs(expectedText: string, includeWhiteSpace?: boolean): void; fileAfterApplyingRefactorAtMarker(markerName: string, expectedContent: string, refactorNameToApply: string, formattingOptions?: FormatCodeOptions): void; importFixAtPosition(expectedTextArray: string[], errorCode?: number): void;