From 8ad404270ce10736b87696c9841ec5ab23e5b420 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Thu, 30 Sep 2021 10:35:40 -0700 Subject: [PATCH] fix test --- .../fourslash/completionsOverridingMethod.ts | 34 ---------------- .../fourslash/completionsOverridingMethod1.ts | 40 +++++++++++++++++++ 2 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 tests/cases/fourslash/completionsOverridingMethod1.ts diff --git a/tests/cases/fourslash/completionsOverridingMethod.ts b/tests/cases/fourslash/completionsOverridingMethod.ts index 3df65b736b4..0097a44c402 100644 --- a/tests/cases/fourslash/completionsOverridingMethod.ts +++ b/tests/cases/fourslash/completionsOverridingMethod.ts @@ -81,17 +81,6 @@ //// f/*g*/ ////} -// @Filename: h.ts -// @noImplicitOverride: true // >> TODO: move this to a new test file, because this option is global -// Case: Suggested method needs `override` modifier -////class HBase { -//// foo(a: string): void {} -////} -//// -////class HSub extends HBase { -//// f/*h*/ -////} - // format.setFormatOptions({ // newLineCharacter: "\n", // }); @@ -258,27 +247,4 @@ foo(a: undefined, b: number): string;\r\n\ foo(a: any, b?: any): string {\r\n $1;\r\n}\r\n", } ], -}); - -verify.completions({ - marker: "h", - isNewIdentifierLocation: true, - preferences: { - includeCompletionsWithInsertText: true, - includeCompletionsWithSnippetText: true, - }, - includes: [ - { - name: "foo", - sortText: completion.SortText.LocationPriority, - replacementSpan: { - fileName: "", - pos: 0, - end: 0, - }, - isSnippet: true, - insertText: -"override foo(): void {\r\n $1;\r\n}\r\n", - } - ], }); \ No newline at end of file diff --git a/tests/cases/fourslash/completionsOverridingMethod1.ts b/tests/cases/fourslash/completionsOverridingMethod1.ts new file mode 100644 index 00000000000..3377ac5c742 --- /dev/null +++ b/tests/cases/fourslash/completionsOverridingMethod1.ts @@ -0,0 +1,40 @@ +/// + +// @Filename: h.ts +// @noImplicitOverride: true +// Case: Suggested method needs `override` modifier +////class HBase { +//// foo(a: string): void {} +////} +//// +////class HSub extends HBase { +//// f/*h*/ +////} + +// format.setFormatOptions({ +// newLineCharacter: "\n", +// }); +// format.setOption("newline", "\n"); + +verify.completions({ + marker: "h", + isNewIdentifierLocation: true, + preferences: { + includeCompletionsWithInsertText: true, + includeCompletionsWithSnippetText: true, + }, + includes: [ + { + name: "foo", + sortText: completion.SortText.LocationPriority, + replacementSpan: { + fileName: "", + pos: 0, + end: 0, + }, + isSnippet: true, + insertText: +"override foo(a: string): void {\r\n $1;\r\n}\r\n", + } + ], +}); \ No newline at end of file