diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index df870034270..61b2c088e14 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2568,9 +2568,7 @@ Actual: ${stringify(fullActual)}`); const originalContent = scriptInfo.content; for (const codeFix of codeFixes) { this.applyEdits(codeFix.changes[0].fileName, codeFix.changes[0].textChanges, /*isFormattingEdit*/ false); - let text = this.rangeText(ranges[0]); - // TODO:GH#18445 (remove this line to see errors in many `importNameCodeFix` tests) - text = text.replace(/\r\n/g, "\n"); + const text = this.rangeText(ranges[0]); actualTextArray.push(text); scriptInfo.updateContent(originalContent); } diff --git a/src/harness/unittests/extractTestHelpers.ts b/src/harness/unittests/extractTestHelpers.ts index a04f443c3c9..f519555bd26 100644 --- a/src/harness/unittests/extractTestHelpers.ts +++ b/src/harness/unittests/extractTestHelpers.ts @@ -121,7 +121,6 @@ namespace ts { const sourceFile = program.getSourceFile(path); const context: RefactorContext = { cancellationToken: { throwIfCancellationRequested: noop, isCancellationRequested: returnFalse }, - newLineCharacter, program, file: sourceFile, startPosition: selectionRange.start, @@ -185,7 +184,6 @@ namespace ts { const sourceFile = program.getSourceFile(f.path); const context: RefactorContext = { cancellationToken: { throwIfCancellationRequested: noop, isCancellationRequested: returnFalse }, - newLineCharacter, program, file: sourceFile, startPosition: selectionRange.start, diff --git a/src/services/codeFixProvider.ts b/src/services/codeFixProvider.ts index aa1f2fb6885..502f8457d8c 100644 --- a/src/services/codeFixProvider.ts +++ b/src/services/codeFixProvider.ts @@ -10,7 +10,6 @@ namespace ts { export interface CodeFixContextBase extends textChanges.TextChangesContext { sourceFile: SourceFile; program: Program; - host: LanguageServiceHost; cancellationToken: CancellationToken; } diff --git a/src/services/codefixes/disableJsDiagnostics.ts b/src/services/codefixes/disableJsDiagnostics.ts index 6a59e61d52d..a887878bac6 100644 --- a/src/services/codefixes/disableJsDiagnostics.ts +++ b/src/services/codefixes/disableJsDiagnostics.ts @@ -9,12 +9,14 @@ namespace ts.codefix { registerCodeFix({ errorCodes, getCodeActions(context) { - const { sourceFile, program, newLineCharacter, span } = context; + const { sourceFile, program, span } = context; if (!isInJavaScriptFile(sourceFile) || !isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { return undefined; } + const newLineCharacter = getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return [{ description: getLocaleSpecificMessage(Diagnostics.Ignore_this_error_message), changes: [createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)])], @@ -36,7 +38,7 @@ namespace ts.codefix { fixIds: [fixId], // No point applying as a group, doing it once will fix all errors getAllCodeActions: context => codeFixAllWithTextChanges(context, errorCodes, (changes, err) => { if (err.start !== undefined) { - changes.push(getIgnoreCommentLocationForLocation(err.file!, err.start, context.newLineCharacter)); + changes.push(getIgnoreCommentLocationForLocation(err.file!, err.start, getNewLineOrDefaultFromHost(context.host, context.formatContext.options))); } }), }); diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index 0fc6a430e19..f7f5aa0a22f 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -142,7 +142,7 @@ namespace ts.codefix { return typeNode || createKeywordTypeNode(SyntaxKind.AnyKeyword); } - function createAddPropertyDeclarationAction(context: textChanges.TextChangesContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, makeStatic: boolean, tokenName: string, typeNode: TypeNode): CodeFixAction { + function createAddPropertyDeclarationAction(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, makeStatic: boolean, tokenName: string, typeNode: TypeNode): CodeFixAction { const description = formatStringFromArgs(getLocaleSpecificMessage(makeStatic ? Diagnostics.Declare_static_property_0 : Diagnostics.Declare_property_0), [tokenName]); const changes = textChanges.ChangeTracker.with(context, t => addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic)); return { description, changes, fixId }; @@ -159,7 +159,7 @@ namespace ts.codefix { changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, property); } - function createAddIndexSignatureAction(context: textChanges.TextChangesContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, typeNode: TypeNode): CodeFixAction { + function createAddIndexSignatureAction(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, tokenName: string, typeNode: TypeNode): CodeFixAction { // Index signatures cannot have the static modifier. const stringTypeNode = createKeywordTypeNode(SyntaxKind.StringKeyword); const indexingParameter = createParameter( @@ -181,7 +181,7 @@ namespace ts.codefix { return { description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_index_signature_for_property_0), [tokenName]), changes, fixId: undefined }; } - function getActionForMethodDeclaration(context: textChanges.TextChangesContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, token: Identifier, callExpression: CallExpression, makeStatic: boolean, inJs: boolean): CodeFixAction | undefined { + function getActionForMethodDeclaration(context: CodeFixContext, classDeclarationSourceFile: SourceFile, classDeclaration: ClassLikeDeclaration, token: Identifier, callExpression: CallExpression, makeStatic: boolean, inJs: boolean): CodeFixAction | undefined { const description = formatStringFromArgs(getLocaleSpecificMessage(makeStatic ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0), [token.text]); const changes = textChanges.ChangeTracker.with(context, t => addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs)); return { description, changes, fixId }; diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index 8f69cd95c11..7e0aefef139 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -29,12 +29,8 @@ namespace ts.codefix { symbolName: string; } - interface SymbolAndTokenContext extends SymbolContext { + interface ImportCodeFixContext extends SymbolContext { symbolToken: Identifier | undefined; - } - - interface ImportCodeFixContext extends SymbolAndTokenContext { - host: LanguageServiceHost; program: Program; checker: TypeChecker; compilerOptions: CompilerOptions; @@ -173,7 +169,6 @@ namespace ts.codefix { const symbolToken = cast(getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false), isIdentifier); return { host: context.host, - newLineCharacter: context.newLineCharacter, formatContext: context.formatContext, sourceFile: context.sourceFile, program, diff --git a/src/services/completions.ts b/src/services/completions.ts index 36a10a1b578..82e7065228a 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -627,7 +627,6 @@ namespace ts.Completions { host, program, checker, - newLineCharacter: host.getNewLine(), compilerOptions, sourceFile, formatContext, diff --git a/src/services/refactorProvider.ts b/src/services/refactorProvider.ts index 85ef9113bda..6177535ee7d 100644 --- a/src/services/refactorProvider.ts +++ b/src/services/refactorProvider.ts @@ -19,7 +19,6 @@ namespace ts { startPosition: number; endPosition?: number; program: Program; - host: LanguageServiceHost; cancellationToken?: CancellationToken; } diff --git a/src/services/services.ts b/src/services/services.ts index 4236416fbb3..1692da9872b 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1887,12 +1887,11 @@ namespace ts { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); const span = createTextSpanFromBounds(start, end); - const newLineCharacter = getNewLineOrDefaultFromHost(host); const formatContext = formatting.getFormatContext(formatOptions); return flatMap(deduplicate(errorCodes, equateValues, compareValues), errorCode => { cancellationToken.throwIfCancellationRequested(); - return codefix.getFixes({ errorCode, sourceFile, span, program, newLineCharacter, host, cancellationToken, formatContext }); + return codefix.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext }); }); } @@ -1900,10 +1899,9 @@ namespace ts { synchronizeHostData(); Debug.assert(scope.type === "file"); const sourceFile = getValidSourceFile(scope.fileName); - const newLineCharacter = getNewLineOrDefaultFromHost(host); const formatContext = formatting.getFormatContext(formatOptions); - return codefix.getAllFixes({ fixId, sourceFile, program, newLineCharacter, host, cancellationToken, formatContext }); + return codefix.getAllFixes({ fixId, sourceFile, program, host, cancellationToken, formatContext }); } function applyCodeActionCommand(action: CodeActionCommand): Promise; @@ -2134,7 +2132,6 @@ namespace ts { startPosition, endPosition, program: getProgram(), - newLineCharacter: formatOptions ? formatOptions.newLineCharacter : host.getNewLine(), host, formatContext: formatting.getFormatContext(formatOptions), cancellationToken, diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 467ba6735ca..3674cd31b97 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -187,7 +187,7 @@ namespace ts.textChanges { } export interface TextChangesContext { - newLineCharacter: string; + host: LanguageServiceHost; formatContext: ts.formatting.FormatContext; } @@ -199,7 +199,7 @@ namespace ts.textChanges { private readonly nodesInsertedAtClassStarts = createMap<{ sourceFile: SourceFile, cls: ClassLikeDeclaration, members: ClassElement[] }>(); public static fromContext(context: TextChangesContext): ChangeTracker { - return new ChangeTracker(context.newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed, context.formatContext); + return new ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options) === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed, context.formatContext); } public static with(context: TextChangesContext, cb: (tracker: ChangeTracker) => void): FileTextChanges[] { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 344a44a9f18..9bb35359523 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1259,8 +1259,10 @@ namespace ts { /** * The default is CRLF. */ - export function getNewLineOrDefaultFromHost(host: LanguageServiceHost | LanguageServiceShimHost) { - return host.getNewLine ? host.getNewLine() : carriageReturnLineFeed; + export function getNewLineOrDefaultFromHost(host: LanguageServiceHost | LanguageServiceShimHost, formatSettings?: FormatCodeSettings) { + return (formatSettings && formatSettings.newLineCharacter) || + (host.getNewLine && host.getNewLine()) || + carriageReturnLineFeed; } export function lineBreakPart() { diff --git a/tests/cases/fourslash/autoFormattingOnPasting.ts b/tests/cases/fourslash/autoFormattingOnPasting.ts index 5c9e2c86e37..7eb08116041 100644 --- a/tests/cases/fourslash/autoFormattingOnPasting.ts +++ b/tests/cases/fourslash/autoFormattingOnPasting.ts @@ -11,12 +11,12 @@ public testMethod( ) }`); // We're missing scenarios of formatting option settings due to bug 693273 - [TypeScript] Need to improve fourslash support for formatting options. // Missing scenario ** Uncheck Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste ** -//verify.currentFileContentIs("module TestModule {\r\n\ -// class TestClass{\r\n\ -//private foo;\r\n\ -//public testMethod( )\r\n\ -//{}\r\n\ -//}\r\n\ +//verify.currentFileContentIs("module TestModule {\n\ +// class TestClass{\n\ +//private foo;\n\ +//public testMethod( )\n\ +//{}\n\ +//}\n\ //}"); // Missing scenario ** Check Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste ** verify.currentFileContentIs(`module TestModule { diff --git a/tests/cases/fourslash/classInterfaceInsert.ts b/tests/cases/fourslash/classInterfaceInsert.ts index e2610532083..d645d6eb8eb 100644 --- a/tests/cases/fourslash/classInterfaceInsert.ts +++ b/tests/cases/fourslash/classInterfaceInsert.ts @@ -12,6 +12,6 @@ verify.quickInfoAt("className", "class Sphere"); goTo.marker('interfaceGoesHere'); -edit.insert("\r\ninterface Surface {\r\n reflect: () => number;\r\n}\r\n"); +edit.insert("\ninterface Surface {\n reflect: () => number;\n}\n"); verify.quickInfoAt("className", "class Sphere"); diff --git a/tests/cases/fourslash/codeFixAddMissingMember.ts b/tests/cases/fourslash/codeFixAddMissingMember.ts index 563cc29f4ea..f5bdf567b20 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember.ts @@ -9,9 +9,8 @@ verify.codeFix({ description: "Declare property 'foo'", index: 0, - // TODO: GH#18445 newFileContent: `class C { - foo: number;\r + foo: number; method() { this.foo = 10; } diff --git a/tests/cases/fourslash/codeFixAddMissingMember2.ts b/tests/cases/fourslash/codeFixAddMissingMember2.ts index 06e111e63c7..a4b7ffb3bfe 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember2.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember2.ts @@ -9,9 +9,8 @@ verify.codeFix({ description: "Add index signature for property 'foo'", index: 1, - // TODO: GH#18445 newFileContent: `class C { - [x: string]: number;\r + [x: string]: number; method() { this.foo = 10; } diff --git a/tests/cases/fourslash/codeFixAddMissingMember3.ts b/tests/cases/fourslash/codeFixAddMissingMember3.ts index adc099eff74..82512406985 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember3.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember3.ts @@ -9,9 +9,8 @@ verify.codeFix({ description: "Declare static property 'foo'", index: 0, - // TODO: GH#18445 newFileContent: `class C { - static foo: number;\r + static foo: number; static method() { this.foo = 10; } diff --git a/tests/cases/fourslash/codeFixAddMissingMember4.ts b/tests/cases/fourslash/codeFixAddMissingMember4.ts index 97a17959d26..58348bca053 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember4.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember4.ts @@ -15,10 +15,9 @@ verify.codeFix({ description: "Initialize property 'foo' in the constructor", index: 0, - // TODO: GH#18445 newFileContent: `class C { - constructor() {\r - this.foo = undefined;\r + constructor() { + this.foo = undefined; } method() { this.foo === 10; diff --git a/tests/cases/fourslash/codeFixAddMissingMember5.ts b/tests/cases/fourslash/codeFixAddMissingMember5.ts index a15b564c786..64a62b8268a 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember5.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember5.ts @@ -13,12 +13,11 @@ verify.codeFix({ description: "Initialize static property 'foo'", index: 0, - // TODO: GH#18445 newFileContent: `class C { static method() { ()=>{ this.foo === 10 }; } -}\r -C.foo = undefined;\r +} +C.foo = undefined; ` }); diff --git a/tests/cases/fourslash/codeFixAddMissingMember6.ts b/tests/cases/fourslash/codeFixAddMissingMember6.ts index a04a14c9ce5..902cafdfb24 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember6.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember6.ts @@ -13,10 +13,9 @@ verify.codeFix({ description: "Initialize property 'foo' in the constructor", index: 0, - // TODO: GH#18445 newFileContent: `class C { - constructor() {\r - this.foo = undefined;\r + constructor() { + this.foo = undefined; } prop = ()=>{ this.foo === 10 }; }` diff --git a/tests/cases/fourslash/codeFixAddMissingMember7.ts b/tests/cases/fourslash/codeFixAddMissingMember7.ts index 0655898218b..6b80901a7bb 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember7.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember7.ts @@ -11,10 +11,9 @@ verify.codeFix({ description: "Initialize static property 'foo'", index: 2, - // TODO: GH#18445 newFileContent: `class C { static p = ()=>{ this.foo === 10 }; -}\r -C.foo = undefined;\r +} +C.foo = undefined; ` }); diff --git a/tests/cases/fourslash/codeFixAddMissingMember_all.ts b/tests/cases/fourslash/codeFixAddMissingMember_all.ts index e7edad47227..ae5e957732b 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember_all.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember_all.ts @@ -11,12 +11,11 @@ verify.codeFixAll({ fixId: "addMissingMember", newFileContent: - // TODO: GH#18445 `class C { - x: number;\r - y(): any {\r - throw new Error("Method not implemented.");\r - }\r + x: number; + y(): any { + throw new Error("Method not implemented."); + } method() { this.x = 0; this.y(); diff --git a/tests/cases/fourslash/codeFixAddMissingMember_all_js.ts b/tests/cases/fourslash/codeFixAddMissingMember_all_js.ts index 1bc0d03c211..305b6d87c30 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember_all_js.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember_all_js.ts @@ -16,13 +16,12 @@ verify.codeFixAll({ fixId: "addMissingMember", newFileContent: - // TODO: GH#18445 `class C { - y() {\r - throw new Error("Method not implemented.");\r - }\r - constructor() {\r - this.x = undefined;\r + y() { + throw new Error("Method not implemented."); + } + constructor() { + this.x = undefined; } method() { this.x; diff --git a/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts b/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts index 68743288c71..9fa45fde8dc 100644 --- a/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts +++ b/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts @@ -12,9 +12,9 @@ verify.codeFix({ `class A { f() {} } -let B = class implements A {\r - f(): void {\r - throw new Error("Method not implemented.");\r - }\r +let B = class implements A { + f(): void { + throw new Error("Method not implemented."); + } }` }); diff --git a/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts b/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts index 76117f05090..ef85b2c6cdf 100644 --- a/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts +++ b/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts @@ -20,7 +20,7 @@ verify.codeFix({ return C; } -let B = class extends foo("s") {\r - a: string | number;\r +let B = class extends foo("s") { + a: string | number; }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts b/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts index b7557419de0..e21b7a21e26 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts @@ -20,7 +20,7 @@ verify.codeFix({ return C; } -class B extends foo("s") {\r - a: string | number;\r +class B extends foo("s") { + a: string | number; }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts b/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts index 4949ddbf7c5..8dd0e508ce9 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts @@ -42,13 +42,13 @@ verify.codeFix({ // Don't need to add anything in this case. abstract class B extends A {} -class C extends A {\r - a: string | number;\r - b: this;\r - c: A;\r - d: string | number;\r - e: this;\r - f: A;\r - g: string;\r +class C extends A { + a: string | number; + b: this; + c: A; + d: string | number; + e: this; + f: A; + g: string; }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts index 462dd1e18ea..7098af8bc27 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts @@ -22,16 +22,16 @@ verify.codeFix({ abstract foo(): number; } -class C extends A {\r - f(a: number, b: string): boolean;\r - f(a: number, b: string): this;\r - f(a: string, b: number): Function;\r - f(a: string): Function;\r - f(a: any, b?: any) {\r - throw new Error("Method not implemented.");\r - }\r - foo(): number {\r - throw new Error("Method not implemented.");\r - }\r +class C extends A { + f(a: number, b: string): boolean; + f(a: number, b: string): this; + f(a: string, b: number): Function; + f(a: string): Function; + f(a: any, b?: any) { + throw new Error("Method not implemented."); + } + foo(): number { + throw new Error("Method not implemented."); + } }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts index 7fa5b762787..f0bb90c9443 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts @@ -14,9 +14,9 @@ verify.codeFix({ abstract f(): this; } -class C extends A {\r - f(): this {\r - throw new Error("Method not implemented.");\r - }\r +class C extends A { + f(): this { + throw new Error("Method not implemented."); + } }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts index 01411fb34cb..fdbbda75113 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts @@ -14,9 +14,9 @@ verify.codeFix({ abstract f(x: T): T; } -class C extends A {\r - f(x: number): number {\r - throw new Error("Method not implemented.");\r - }\r +class C extends A { + f(x: number): number { + throw new Error("Method not implemented."); + } }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts index aff612ac95d..41fe94ae634 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts @@ -14,9 +14,9 @@ verify.codeFix({ abstract f(x: T): T; } -class C extends A {\r - f(x: U): U {\r - throw new Error("Method not implemented.");\r - }\r +class C extends A { + f(x: U): U { + throw new Error("Method not implemented."); + } }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts index ba6afb9ac7a..9521173ad89 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts @@ -8,19 +8,18 @@ verify.codeFixAll({ fixId: "fixClassDoesntImplementInheritedAbstractMember", - // TODO: GH#18445 newFileContent: `abstract class A { abstract m(): void; } -class B extends A {\r - m(): void {\r - throw new Error("Method not implemented.");\r - }\r +class B extends A { + m(): void { + throw new Error("Method not implemented."); + } } -class C extends A {\r - m(): void {\r - throw new Error("Method not implemented.");\r - }\r +class C extends A { + m(): void { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts b/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts index 6fd77e90385..e5811016e8c 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts @@ -18,9 +18,9 @@ verify.codeFix({ abstract z: A; } -class C extends A {\r - x: number;\r - y: this;\r - z: A;\r +class C extends A { + x: number; + y: this; + z: A; }` }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractPropertyThis.ts b/tests/cases/fourslash/codeFixClassExtendAbstractPropertyThis.ts index 9531c3b7533..06b9dddcd8a 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractPropertyThis.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractPropertyThis.ts @@ -8,13 +8,12 @@ verify.codeFix({ description: "Implement inherited abstract class", - // TODO: GH#18445 newFileContent: `abstract class A { abstract x: this; } -class C extends A {\r - x: this;\r +class C extends A { + x: this; }`, }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractProtectedProperty.ts b/tests/cases/fourslash/codeFixClassExtendAbstractProtectedProperty.ts index 63a3ed99f67..a150dd07f8d 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractProtectedProperty.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractProtectedProperty.ts @@ -8,13 +8,12 @@ verify.codeFix({ description: "Implement inherited abstract class", - // TODO: GH#18445 newFileContent: `abstract class A { protected abstract x: number; } -class C extends A {\r - protected x: number;\r +class C extends A { + protected x: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractPublicProperty.ts b/tests/cases/fourslash/codeFixClassExtendAbstractPublicProperty.ts index c8696b1ad6c..48a023e96fa 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractPublicProperty.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractPublicProperty.ts @@ -8,13 +8,12 @@ verify.codeFix({ description: "Implement inherited abstract class", - // TODO: GH#18445 newFileContent: `abstract class A { public abstract x: number; } -class C extends A {\r - public x: number;\r +class C extends A { + public x: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementClassAbstractGettersAndSetters.ts b/tests/cases/fourslash/codeFixClassImplementClassAbstractGettersAndSetters.ts index f6fac956c5b..adea74627b8 100644 --- a/tests/cases/fourslash/codeFixClassImplementClassAbstractGettersAndSetters.ts +++ b/tests/cases/fourslash/codeFixClassImplementClassAbstractGettersAndSetters.ts @@ -15,7 +15,6 @@ verify.codeFix({ description: "Implement interface 'A'", - // TODO: GH#18445 newFileContent: `abstract class A { private _a: string; @@ -28,9 +27,9 @@ verify.codeFix({ abstract set c(arg: number | string); } -class C implements A {\r - a: string;\r - b: number;\r - c: string | number;\r +class C implements A { + a: string; + b: number; + c: string | number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementClassFunctionVoidInferred.ts b/tests/cases/fourslash/codeFixClassImplementClassFunctionVoidInferred.ts index dbc0689644f..115517f4e6d 100644 --- a/tests/cases/fourslash/codeFixClassImplementClassFunctionVoidInferred.ts +++ b/tests/cases/fourslash/codeFixClassImplementClassFunctionVoidInferred.ts @@ -8,15 +8,14 @@ verify.codeFix({ description: "Implement interface 'A'", - // TODO: GH#18445 newFileContent: `class A { f() {} } -class B implements A {\r - f(): void {\r - throw new Error("Method not implemented.");\r - }\r +class B implements A { + f(): void { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures1.ts b/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures1.ts index 8c563d4dbb7..a0b59c6372c 100644 --- a/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures1.ts +++ b/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures1.ts @@ -8,16 +8,15 @@ verify.codeFix({ description: "Implement interface 'A'", - // TODO: GH#18445 newFileContent: `class A { method(a: number, b: string): boolean; method(a: string | number, b?: string | number): boolean | Function { return true; } } -class C implements A {\r - method(a: number, b: string): boolean;\r - method(a: string | number, b?: string | number): boolean | Function {\r - throw new Error("Method not implemented.");\r - }\r +class C implements A { + method(a: number, b: string): boolean; + method(a: string | number, b?: string | number): boolean | Function { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures2.ts b/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures2.ts index de2bfab561e..dcd5636428d 100644 --- a/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures2.ts +++ b/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures2.ts @@ -10,7 +10,6 @@ verify.codeFix({ description: "Implement interface 'A'", - // TODO: GH#18445 newFileContent: `class A { method(a: any, b: string): boolean; @@ -18,12 +17,12 @@ verify.codeFix({ method(a: string): Function; method(a: string | number, b?: string | number): boolean | Function { return true; } } -class C implements A {\r - method(a: any, b: string): boolean;\r - method(a: string, b: number): Function;\r - method(a: string): Function;\r - method(a: string | number, b?: string | number): boolean | Function {\r - throw new Error("Method not implemented.");\r - }\r +class C implements A { + method(a: any, b: string): boolean; + method(a: string, b: number): Function; + method(a: string): Function; + method(a: string | number, b?: string | number): boolean | Function { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementClassPropertyModifiers.ts b/tests/cases/fourslash/codeFixClassImplementClassPropertyModifiers.ts index f3aa6bc6c6c..7e7a712b60e 100644 --- a/tests/cases/fourslash/codeFixClassImplementClassPropertyModifiers.ts +++ b/tests/cases/fourslash/codeFixClassImplementClassPropertyModifiers.ts @@ -11,7 +11,6 @@ verify.codeFix({ description: "Implement interface 'A'", - // TODO: GH#18445 newFileContent: `abstract class A { abstract x: number; @@ -20,9 +19,9 @@ verify.codeFix({ public w: number; } -class C implements A {\r - x: number;\r - protected z: number;\r - public w: number;\r +class C implements A { + x: number; + protected z: number; + public w: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementClassPropertyTypeQuery.ts b/tests/cases/fourslash/codeFixClassImplementClassPropertyTypeQuery.ts index 0981db995bb..3c34de1e1bf 100644 --- a/tests/cases/fourslash/codeFixClassImplementClassPropertyTypeQuery.ts +++ b/tests/cases/fourslash/codeFixClassImplementClassPropertyTypeQuery.ts @@ -7,12 +7,11 @@ verify.codeFix({ description: "Implement interface 'A'", - // TODO: GH#18445 newFileContent: `class A { A: typeof A; } -class D implements A {\r - A: typeof A;\r +class D implements A { + A: typeof A; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementDeepInheritance.ts b/tests/cases/fourslash/codeFixClassImplementDeepInheritance.ts index ae187b93572..c9a568effbf 100644 --- a/tests/cases/fourslash/codeFixClassImplementDeepInheritance.ts +++ b/tests/cases/fourslash/codeFixClassImplementDeepInheritance.ts @@ -50,7 +50,6 @@ verify.codeFix({ description: "Implement interface 'I6'", - // TODO: GH#18445 newFileContent: `// Referenced throughout the inheritance chain. interface I0 { a: number } @@ -75,12 +74,12 @@ class C4 extends C3 implements I0, I4, I5 { } interface I6 extends C4 {} -class C5 implements I6 {\r - e: number;\r - f: number;\r - a: number;\r - b: number;\r - d: number;\r - c: number;\r +class C5 implements I6 { + e: number; + f: number; + a: number; + b: number; + d: number; + c: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementDefaultClass.ts b/tests/cases/fourslash/codeFixClassImplementDefaultClass.ts index 53fb9378591..8793872ce95 100644 --- a/tests/cases/fourslash/codeFixClassImplementDefaultClass.ts +++ b/tests/cases/fourslash/codeFixClassImplementDefaultClass.ts @@ -5,10 +5,9 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: number; } -export default class implements I {\r - x: number;\r +export default class implements I { + x: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceArrayTuple.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceArrayTuple.ts index b121fe54ac7..c6ad69ffb44 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceArrayTuple.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceArrayTuple.ts @@ -10,7 +10,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: number[]; @@ -18,9 +17,9 @@ verify.codeFix({ z: [number, string, I]; } -class C implements I {\r - x: number[];\r - y: number[];\r - z: [number, string, I];\r +class C implements I { + x: number[]; + y: number[]; + z: [number, string, I]; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceClassExpression.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceClassExpression.ts index 8b811a98d25..cd9b689736d 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceClassExpression.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceClassExpression.ts @@ -6,10 +6,9 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: number; } -new class implements I {\r - x: number;\r +new class implements I { + x: number; };`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceComments.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceComments.ts index 98a00d43f4c..793ad944732 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceComments.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceComments.ts @@ -20,7 +20,6 @@ verify.codeFix({ description: "Implement interface 'N.I'", - // TODO: GH#18445 newFileContent: `namespace N { /**enum prefix */ @@ -36,11 +35,11 @@ verify.codeFix({ /**method signature prefix */foo /**open angle prefix */< /**type parameter name prefix */ X /** closing angle prefix */> /**open paren prefix */(/** parameter prefix */ a/** colon prefix */: /** parameter type prefix */ X /** close paren prefix */) /** colon prefix */: /** return type prefix */ string /** semicolon prefix */; /**close-brace prefix*/ } /**close-brace prefix*/ } -class C implements N.I {\r - /** property prefix */ a /** colon prefix */: N.E.a;\r - /** property prefix */ b /** colon prefix */: N.E;\r - /**method signature prefix */ foo /**open angle prefix */(a: X): string {\r - throw new Error("Method not implemented.");\r - }\r +class C implements N.I { + /** property prefix */ a /** colon prefix */: N.E.a; + /** property prefix */ b /** colon prefix */: N.E; + /**method signature prefix */ foo /**open angle prefix */(a: X): string { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyLiterals.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyLiterals.ts index 6bbe5f4efd1..daa46c6b2e9 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyLiterals.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyLiterals.ts @@ -11,7 +11,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { ["foo"](o: any): boolean; @@ -20,14 +19,14 @@ verify.codeFix({ [2]: boolean; } -class C implements I {\r - ["foo"](o: any): boolean {\r - throw new Error("Method not implemented.");\r - }\r - ["x"]: boolean;\r - [1](): string {\r - throw new Error("Method not implemented.");\r - }\r - [2]: boolean;\r +class C implements I { + ["foo"](o: any): boolean { + throw new Error("Method not implemented."); + } + ["x"]: boolean; + [1](): string { + throw new Error("Method not implemented."); + } + [2]: boolean; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts index ab8b7ddfebb..2bc7a738258 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceComputedPropertyNameWellKnownSymbols.ts @@ -21,7 +21,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { [Symbol.hasInstance](o: any): boolean; @@ -38,34 +37,34 @@ verify.codeFix({ [Symbol.toStringTag]: string; [Symbol.unscopables]: any; } -class C implements I {\r - [Symbol.hasInstance](o: any): boolean {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.isConcatSpreadable]: boolean;\r - [Symbol.iterator]() {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.match]: boolean;\r - [Symbol.replace](...args: {}) {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.search](str: string): number {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.species](): number {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.split](str: string, limit?: number): {} {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.toPrimitive](hint: "number"): number;\r - [Symbol.toPrimitive](hint: "default"): number;\r - [Symbol.toPrimitive](hint: "string"): string;\r - [Symbol.toPrimitive](hint: any) {\r - throw new Error("Method not implemented.");\r - }\r - [Symbol.toStringTag]: string\;\r - [Symbol.unscopables]: any;\r +class C implements I { + [Symbol.hasInstance](o: any): boolean { + throw new Error("Method not implemented."); + } + [Symbol.isConcatSpreadable]: boolean; + [Symbol.iterator]() { + throw new Error("Method not implemented."); + } + [Symbol.match]: boolean; + [Symbol.replace](...args: {}) { + throw new Error("Method not implemented."); + } + [Symbol.search](str: string): number { + throw new Error("Method not implemented."); + } + [Symbol.species](): number { + throw new Error("Method not implemented."); + } + [Symbol.split](str: string, limit?: number): {} { + throw new Error("Method not implemented."); + } + [Symbol.toPrimitive](hint: "number"): number; + [Symbol.toPrimitive](hint: "default"): number; + [Symbol.toPrimitive](hint: "string"): string; + [Symbol.toPrimitive](hint: any) { + throw new Error("Method not implemented."); + } + [Symbol.toStringTag]: string\; + [Symbol.unscopables]: any; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceInNamespace.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceInNamespace.ts index 9e01e080af6..0a28afd4b5d 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceInNamespace.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceInNamespace.ts @@ -13,7 +13,6 @@ verify.codeFix({ description: "Implement interface 'N1.I1'", - // TODO: GH#18445 newFileContent: `namespace N1 { export interface I1 { @@ -24,9 +23,9 @@ interface I1 { f1(); } -class C1 implements N1.I1 {\r - f1(): string {\r - throw new Error("Method not implemented.");\r - }\r +class C1 implements N1.I1 { + f1(): string { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesBoth.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesBoth.ts index 2becd28aa4f..15fdcdab913 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesBoth.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesBoth.ts @@ -10,15 +10,14 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { [x: number]: I; [y: string]: I; } -class C implements I {\r - [x: number]: I;\r - [y: string]: I;\r +class C implements I { + [x: number]: I; + [y: string]: I; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNumber.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNumber.ts index ebd0904e88a..ede4ed4f568 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNumber.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesNumber.ts @@ -7,12 +7,11 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { [x: number]: I; } -class C implements I {\r - [x: number]: I;\r +class C implements I { + [x: number]: I; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesString.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesString.ts index 4cd6cd0c9a3..2e2c49d2700 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesString.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexSignaturesString.ts @@ -8,13 +8,12 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { [Ƚ: string]: X; } -class C implements I {\r - [Ƚ: string]: number;\r +class C implements I { + [Ƚ: string]: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexType.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexType.ts index 7e93871c552..2a2b4c32c1b 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceIndexType.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceIndexType.ts @@ -7,12 +7,11 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: keyof X; } -class C implements I {\r - x: keyof Y;\r +class C implements I { + x: keyof Y; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceInheritsAbstractMethod.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceInheritsAbstractMethod.ts index 83a2c131d97..516919b13df 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceInheritsAbstractMethod.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceInheritsAbstractMethod.ts @@ -9,16 +9,15 @@ verify.codeFix({ description: "Implement interface 'I1'", - // TODO: GH#18445 newFileContent: `abstract class C1 { } abstract class C2 { abstract fA(); } interface I1 extends C1, C2 { } -class C3 implements I1 {\r - fA() {\r - throw new Error("Method not implemented.");\r - }\r +class C3 implements I1 { + fA() { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMappedType.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMappedType.ts index 5fff622f2db..17f8ccb0bea 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMappedType.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMappedType.ts @@ -7,12 +7,11 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: { readonly [K in keyof X]: X[K] }; } -class C implements I {\r - x: { readonly [K in keyof Y]: Y[K]; };\r +class C implements I { + x: { readonly [K in keyof Y]: Y[K]; }; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMemberNestedTypeAlias.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMemberNestedTypeAlias.ts index fc1217f1556..722fe51d0a5 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMemberNestedTypeAlias.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMemberNestedTypeAlias.ts @@ -9,17 +9,16 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `type Either = { val: T } | Error; interface I { x: Either>; foo(x: Either>): void; } -class C implements I {\r - x: Either>;\r - foo(x: Either>): void {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + x: Either>; + foo(x: Either>): void { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMemberOrdering.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMemberOrdering.ts index 4bb20142df3..9c5bd172e8f 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMemberOrdering.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMemberOrdering.ts @@ -33,7 +33,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `/** asdf */ interface I { @@ -62,30 +61,30 @@ interface I { /** a nice safe prime */ 23; } -class C implements I {\r - 1: any;\r - 2: any;\r - 3: any;\r - 4: any;\r - 5: any;\r - 6: any;\r - 7: any;\r - 8: any;\r - 9: any;\r - 10: any;\r - 11: any;\r - 12: any;\r - 13: any;\r - 14: any;\r - 15: any;\r - 16: any;\r - 17: any;\r - 18: any;\r - 19: any;\r - 20: any;\r - 21: any;\r - 22: any;\r - /** a nice safe prime */\r - 23: any;\r +class C implements I { + 1: any; + 2: any; + 3: any; + 4: any; + 5: any; + 6: any; + 7: any; + 8: any; + 9: any; + 10: any; + 11: any; + 12: any; + 13: any; + 14: any; + 15: any; + 16: any; + 17: any; + 18: any; + 19: any; + 20: any; + 21: any; + 22: any; + /** a nice safe prime */ + 23: any; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMemberTypeAlias.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMemberTypeAlias.ts index 23f1c79054e..6fd8900d51b 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMemberTypeAlias.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMemberTypeAlias.ts @@ -6,14 +6,13 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `type MyType = [string, number]; interface I { x: MyType; test(a: MyType): void; } -class C implements I {\r - x: [string, number];\r - test(a: [string, number]): void {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + x: [string, number]; + test(a: [string, number]): void { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMethodThisAndSelfReference.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMethodThisAndSelfReference.ts index 41c8f2254db..4dfeb7cd95b 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMethodThisAndSelfReference.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMethodThisAndSelfReference.ts @@ -8,15 +8,14 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { f(x: number, y: this): I } -class C implements I {\r - f(x: number, y: this): I {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + f(x: number, y: this): I { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMethodTypePredicate.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMethodTypePredicate.ts index ce1dfead0f3..45bd6096142 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMethodTypePredicate.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMethodTypePredicate.ts @@ -9,18 +9,17 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { f(i: any): i is I; f(): this is I; } -class C implements I {\r - f(i: any): i is I;\r - f(): this is I;\r - f(i?: any) {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + f(i: any): i is I; + f(): this is I; + f(i?: any) { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleMembersAndPunctuation.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleMembersAndPunctuation.ts index afad257a699..bc52629e8e9 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleMembersAndPunctuation.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleMembersAndPunctuation.ts @@ -13,7 +13,6 @@ verify.codeFix({ description: "Implement interface 'I1'", - // TODO: GH#18445 newFileContent: `interface I1 { x: number, @@ -24,18 +23,18 @@ verify.codeFix({ h(); } -class C1 implements I1 {\r - x: number;\r - y: number;\r - z: number;\r - f() {\r - throw new Error("Method not implemented.");\r - }\r - g() {\r - throw new Error("Method not implemented.");\r - }\r - h() {\r - throw new Error("Method not implemented.");\r - }\r +class C1 implements I1 { + x: number; + y: number; + z: number; + f() { + throw new Error("Method not implemented."); + } + g() { + throw new Error("Method not implemented."); + } + h() { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignatures.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignatures.ts index b8167ccf35b..ddfc21615a3 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignatures.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignatures.ts @@ -10,7 +10,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { method(a: number, b: string): boolean; @@ -18,12 +17,12 @@ verify.codeFix({ method(a: string): Function; } -class C implements I {\r - method(a: number, b: string): boolean;\r - method(a: string, b: number): Function;\r - method(a: string): Function;\r - method(a: any, b?: any) {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + method(a: number, b: string): boolean; + method(a: string, b: number): Function; + method(a: string): Function; + method(a: any, b?: any) { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest1.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest1.ts index ee64c1be6bb..868a48711b2 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest1.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest1.ts @@ -10,7 +10,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { method(a: number, ...b: string[]): boolean; @@ -18,12 +17,12 @@ verify.codeFix({ method(a: string): Function; } -class C implements I {\r - method(a: number, ...b: string[]): boolean;\r - method(a: string, ...b: number[]): Function;\r - method(a: string): Function;\r - method(a: any, ...b?: any[]) {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + method(a: number, ...b: string[]): boolean; + method(a: string, ...b: number[]): Function; + method(a: string): Function; + method(a: any, ...b?: any[]) { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest2.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest2.ts index 9b4e471a5d8..29689f17ea7 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest2.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest2.ts @@ -10,7 +10,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { method(a: number, ...b: string[]): boolean; @@ -18,12 +17,12 @@ verify.codeFix({ method(a: string): Function; } -class C implements I {\r - method(a: number, ...b: string[]): boolean;\r - method(a: string, b: number): Function;\r - method(a: string): Function;\r - method(a: any, b?: any, ...rest?: any[]) {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + method(a: number, ...b: string[]): boolean; + method(a: string, b: number): Function; + method(a: string): Function; + method(a: any, b?: any, ...rest?: any[]) { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceNamespaceConflict.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceNamespaceConflict.ts index ee9808603cf..a2b20c52f15 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceNamespaceConflict.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceNamespaceConflict.ts @@ -10,7 +10,6 @@ verify.codeFix({ description: "Implement interface 'N1.I1'", - // TODO: GH#18445 newFileContent: `namespace N1 { export interface I1 { x: number; } @@ -18,7 +17,7 @@ verify.codeFix({ interface I1 { f1(); } -class C1 implements N1.I1 {\r - x: number;\r +class C1 implements N1.I1 { + x: number; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceOptionalProperty.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceOptionalProperty.ts index ea4f5dbdd91..9cb6f477733 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceOptionalProperty.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceOptionalProperty.ts @@ -8,14 +8,13 @@ verify.codeFix({ description: "Implement interface 'IPerson'", - // TODO: GH#18445 newFileContent: `interface IPerson { name: string; birthday?: string; } -class Person implements IPerson {\r - name: string;\r - birthday?: string;\r +class Person implements IPerson { + name: string; + birthday?: string; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceProperty.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceProperty.ts index f8fb576800f..6fc8d8955bb 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceProperty.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceProperty.ts @@ -13,7 +13,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `enum E { a,b,c } interface I { @@ -22,10 +21,10 @@ interface I { z: symbol; w: object; } -class C implements I {\r - x: E;\r - y: E.a;\r - z: symbol;\r - w: object;\r +class C implements I { + x: E; + y: E.a; + z: symbol; + w: object; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfacePropertySignatures.ts b/tests/cases/fourslash/codeFixClassImplementInterfacePropertySignatures.ts index 98a0f374ae7..52d69b466fd 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfacePropertySignatures.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfacePropertySignatures.ts @@ -21,7 +21,6 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { a0: {}; @@ -40,17 +39,17 @@ verify.codeFix({ a9: { (b9: number, c9: string): number; [d9: number]: I }; a10: { (b10: number, c10: string): number; [d10: string]: I }; } -class C implements I {\r - a0: {};\r - a1: (b1: number, c1: string) => number;\r - a2: (b2: number, c2: string) => number;\r - a3: { (b3: number, c3: string): number; x: number; };\r - a4: new (b1: number, c1: string) => number;\r - a5: new (b2: number, c2: string) => number;\r - a6: { new(b3: number, c3: string): number; x: number; };\r - a7: { foo(b7: number, c7: string): number; };\r - a8: { (b81: number, c81: string): number; new(b82: number, c82: string): number; };\r - a9: { (b9: number, c9: string): number;[d9: number]: I; };\r - a10: { (b10: number, c10: string): number;[d10: string]: I; };\r +class C implements I { + a0: {}; + a1: (b1: number, c1: string) => number; + a2: (b2: number, c2: string) => number; + a3: { (b3: number, c3: string): number; x: number; }; + a4: new (b1: number, c1: string) => number; + a5: new (b2: number, c2: string) => number; + a6: { new(b3: number, c3: string): number; x: number; }; + a7: { foo(b7: number, c7: string): number; }; + a8: { (b81: number, c81: string): number; new(b82: number, c82: string): number; }; + a9: { (b9: number, c9: string): number;[d9: number]: I; }; + a10: { (b10: number, c10: string): number;[d10: string]: I; }; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceQualifiedName.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceQualifiedName.ts index c8e88bced9f..b587d937062 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceQualifiedName.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceQualifiedName.ts @@ -7,12 +7,11 @@ verify.codeFix({ description: "Implement interface 'N.I'", - // TODO: GH#18445 newFileContent: `namespace N { export interface I { y: I; } } -class C1 implements N.I {\r - y: N.I;\r +class C1 implements N.I { + y: N.I; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateDeeply.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateDeeply.ts index 4b50cf2e69b..cf8926ff33e 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateDeeply.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateDeeply.ts @@ -7,12 +7,11 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: { y: T, z: T[] }; } -class C implements I {\r - x: { y: number; z: number[]; };\r +class C implements I { + x: { y: number; z: number[]; }; }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateNumber.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateNumber.ts index 6df183d3e44..88f0d32fe18 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateNumber.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateNumber.ts @@ -5,10 +5,9 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: T; } -class C implements I {\r - x: number;\r +class C implements I { + x: number; }` }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateT.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateT.ts index 7be7d21f1e4..504b1684632 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateT.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateT.ts @@ -5,10 +5,9 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: T; } -class C implements I {\r - x: T;\r +class C implements I { + x: T; }` }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateU.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateU.ts index ac4cad80220..c189fed4c8c 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateU.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamInstantiateU.ts @@ -5,10 +5,9 @@ verify.codeFix({ description: "Implement interface 'I'", - // TODO: GH#18445 newFileContent: `interface I { x: T; } -class C implements I {\r - x: U;\r +class C implements I { + x: U; }` }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamMethod.ts b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamMethod.ts index 6a93c84ecf0..70db2b5908c 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamMethod.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterfaceTypeParamMethod.ts @@ -8,13 +8,12 @@ verify.codeFix({ description: "Implement interface 'I'", newFileContent: - // TODO: GH#18445 `interface I { f(x: T); } -class C implements I {\r - f(x: T) {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I { + f(x: T) { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterface_all.ts b/tests/cases/fourslash/codeFixClassImplementInterface_all.ts index fb3672a7949..cc27e395ed7 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterface_all.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterface_all.ts @@ -7,21 +7,21 @@ verify.codeFixAll({ fixId: "fixClassIncorrectlyImplementsInterface", - // TODO: GH#20073 GH#18445 + // TODO: GH#20073 newFileContent: `interface I { i(): void; } interface J { j(): void; } -class C implements I, J {\r - i(): void {\r - throw new Error("Method not implemented.");\r - }\r - j(): void {\r - throw new Error("Method not implemented.");\r - }\r +class C implements I, J { + i(): void { + throw new Error("Method not implemented."); + } + j(): void { + throw new Error("Method not implemented."); + } } -class D implements J {\r - j(): void {\r - throw new Error("Method not implemented.");\r - }\r +class D implements J { + j(): void { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess.ts b/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess.ts index a4db2c909fd..5d1772ba8b8 100644 --- a/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess.ts +++ b/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess.ts @@ -9,8 +9,7 @@ //// super(); //// |]} ////} -// TODO: GH#18445 verify.rangeAfterCodeFix(` - super();\r + super(); this.a = 12; `, /*includeWhiteSpace*/ true); diff --git a/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess_all.ts b/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess_all.ts index 0b12fb4b03d..96f3677fda7 100644 --- a/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess_all.ts +++ b/tests/cases/fourslash/codeFixClassSuperMustPrecedeThisAccess_all.ts @@ -18,14 +18,14 @@ verify.codeFixAll({ fixId: "classSuperMustPrecedeThisAccess", newFileContent: `class C extends Object { constructor() { - super();\r + super(); this; this; } } class D extends Object { constructor() { - super();\r + super(); this; } }`, diff --git a/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall.ts b/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall.ts index 402d4196360..154eda0e084 100644 --- a/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall.ts +++ b/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall.ts @@ -8,13 +8,12 @@ verify.codeFix({ description: "Add missing 'super()' call", - // TODO: GH#18445 newFileContent: `class Base{ } class C extends Base{ - constructor() {\r - super();\r + constructor() { + super(); } }`, }); diff --git a/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall_all.ts b/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall_all.ts index 8aa0e2c6ade..3833af62de0 100644 --- a/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall_all.ts +++ b/tests/cases/fourslash/codeFixConstructorForDerivedNeedSuperCall_all.ts @@ -9,15 +9,14 @@ verify.codeFixAll({ fixId: "constructorForDerivedNeedSuperCall", - // TODO: GH#18445 newFileContent: `class C extends Object { - constructor() {\r - super();\r + constructor() { + super(); } } class D extends Object { - constructor() {\r - super();\r + constructor() { + super(); } }`, }); diff --git a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile_all.ts b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile_all.ts index 527ecb66848..9c3785cf2ae 100644 --- a/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile_all.ts +++ b/tests/cases/fourslash/codeFixDisableJsDiagnosticsInFile_all.ts @@ -13,8 +13,8 @@ verify.codeFixAll({ fixId: "disableJsDiagnostics", newFileContent: `let x = ""; -// @ts-ignore\r +// @ts-ignore x = 1; -// @ts-ignore\r +// @ts-ignore x = true;`, }); diff --git a/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts b/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts index b1fac4e0f12..0bd4ac3a879 100644 --- a/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts +++ b/tests/cases/fourslash/codeFixUndeclaredInStaticMethod.ts @@ -12,11 +12,10 @@ verify.codeFix({ description: "Declare static method 'm1'", index: 0, - // TODO: GH#18445 newRangeContent: ` - static m1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + static m1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } `, }); @@ -24,12 +23,12 @@ verify.codeFix({ description: "Declare static method 'm2'", index: 0, newRangeContent: ` - static m2(arg0: any, arg1: any): any {\r - throw new Error("Method not implemented.");\r - }\r - static m1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + static m2(arg0: any, arg1: any): any { + throw new Error("Method not implemented."); + } + static m1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } `, }); @@ -37,13 +36,13 @@ verify.codeFix({ description: "Declare static property 'prop1'", index: 0, newRangeContent: ` - static prop1: number;\r - static m2(arg0: any, arg1: any): any {\r - throw new Error("Method not implemented.");\r - }\r - static m1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + static prop1: number; + static m2(arg0: any, arg1: any): any { + throw new Error("Method not implemented."); + } + static m1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } `, }); @@ -51,13 +50,13 @@ verify.codeFix({ description: "Declare static property 'prop2'", index: 0, newRangeContent: ` - static prop2: string;\r - static prop1: number;\r - static m2(arg0: any, arg1: any): any {\r - throw new Error("Method not implemented.");\r - }\r - static m1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + static prop2: string; + static prop1: number; + static m2(arg0: any, arg1: any): any { + throw new Error("Method not implemented."); + } + static m1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } `, }); diff --git a/tests/cases/fourslash/codeFixUndeclaredMethod.ts b/tests/cases/fourslash/codeFixUndeclaredMethod.ts index 2f291490b14..70ed58b995b 100644 --- a/tests/cases/fourslash/codeFixUndeclaredMethod.ts +++ b/tests/cases/fourslash/codeFixUndeclaredMethod.ts @@ -13,11 +13,10 @@ verify.codeFix({ description: "Declare method 'foo1'", index: 0, - // TODO: GH#18445 newRangeContent: ` - foo1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + foo1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } `, }); @@ -25,12 +24,12 @@ verify.codeFix({ description: "Declare method 'foo2'", index: 0, newRangeContent: ` - foo2(): any {\r - throw new Error("Method not implemented.");\r - }\r - foo1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + foo2(): any { + throw new Error("Method not implemented."); + } + foo1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } ` }); @@ -38,14 +37,14 @@ verify.codeFix({ description: "Declare method 'foo3'", index: 0, newRangeContent:` - foo3(): any {\r - throw new Error("Method not implemented.");\r - }\r - foo2(): any {\r - throw new Error("Method not implemented.");\r - }\r - foo1(arg0: any, arg1: any, arg2: any): any {\r - throw new Error("Method not implemented.");\r - }\r + foo3(): any { + throw new Error("Method not implemented."); + } + foo2(): any { + throw new Error("Method not implemented."); + } + foo1(arg0: any, arg1: any, arg2: any): any { + throw new Error("Method not implemented."); + } ` }); diff --git a/tests/cases/fourslash/completionAfterBackslashFollowingString.ts b/tests/cases/fourslash/completionAfterBackslashFollowingString.ts index e8eeeb571b6..2e8587ffd1f 100644 --- a/tests/cases/fourslash/completionAfterBackslashFollowingString.ts +++ b/tests/cases/fourslash/completionAfterBackslashFollowingString.ts @@ -1,6 +1,6 @@ /// -////Harness.newLine = "\r"\n/**/ +////Harness.newLine = ""\n/**/ goTo.marker(); verify.not.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts b/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts index 09c0e74002b..75c45c2970b 100644 --- a/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts +++ b/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts @@ -17,8 +17,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 newFileContent: `import f_o_o from "./a"; -import foo from "./a";\r +import foo from "./a"; f;`, }); diff --git a/tests/cases/fourslash/completionsImport_default_anonymous.ts b/tests/cases/fourslash/completionsImport_default_anonymous.ts index 35489c1110b..ca9d9579901 100644 --- a/tests/cases/fourslash/completionsImport_default_anonymous.ts +++ b/tests/cases/fourslash/completionsImport_default_anonymous.ts @@ -22,9 +22,8 @@ verify.applyCodeActionFromCompletion("1", { name: "fooBar", source: "/src/foo-bar", description: `Import 'fooBar' from module "./foo-bar"`, - // TODO: GH#18445 - newFileContent: `import fooBar from "./foo-bar";\r -\r + newFileContent: `import fooBar from "./foo-bar"; + def fooB`, }); diff --git a/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts b/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts index 558be4bee03..0e9edb4d1b2 100644 --- a/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts +++ b/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts @@ -18,8 +18,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 - newFileContent: `import foo from "./a";\r -\r + newFileContent: `import foo from "./a"; + f;`, }); diff --git a/tests/cases/fourslash/completionsImport_default_exportDefaultIdentifier.ts b/tests/cases/fourslash/completionsImport_default_exportDefaultIdentifier.ts index 7549c2e001b..45cdf71156e 100644 --- a/tests/cases/fourslash/completionsImport_default_exportDefaultIdentifier.ts +++ b/tests/cases/fourslash/completionsImport_default_exportDefaultIdentifier.ts @@ -19,8 +19,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 - newFileContent: `import foo from "./a";\r -\r + newFileContent: `import foo from "./a"; + f;`, }); diff --git a/tests/cases/fourslash/completionsImport_fromAmbientModule.ts b/tests/cases/fourslash/completionsImport_fromAmbientModule.ts index db9b586eb42..43789dea095 100644 --- a/tests/cases/fourslash/completionsImport_fromAmbientModule.ts +++ b/tests/cases/fourslash/completionsImport_fromAmbientModule.ts @@ -12,8 +12,7 @@ verify.applyCodeActionFromCompletion("", { name: "x", source: "m", description: `Import 'x' from module "m"`, - // TODO: GH#18445 - newFileContent: `import { x } from "m";\r -\r + newFileContent: `import { x } from "m"; + `, }); diff --git a/tests/cases/fourslash/completionsImport_multipleWithSameName.ts b/tests/cases/fourslash/completionsImport_multipleWithSameName.ts index d85c04ce9f8..da118826235 100644 --- a/tests/cases/fourslash/completionsImport_multipleWithSameName.ts +++ b/tests/cases/fourslash/completionsImport_multipleWithSameName.ts @@ -23,8 +23,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/b", description: `Import 'foo' from module "./b"`, - // TODO: GH#18445 - newFileContent: `import { foo } from "./b";\r -\r + newFileContent: `import { foo } from "./b"; + fo`, }); diff --git a/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts b/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts index b88ce9cae0d..788c9695e45 100644 --- a/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts +++ b/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts @@ -19,8 +19,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 - newFileContent: `import { foo } from "./a";\r -\r + newFileContent: `import { foo } from "./a"; + f;`, }); diff --git a/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts b/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts index 112cecba74a..fddd8ae12ca 100644 --- a/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts +++ b/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts @@ -17,7 +17,6 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/a", description: `Change 'foo' to 'a.foo'`, - // TODO: GH#18445 newFileContent: `import * as a from "./a"; a.f;`, }); diff --git a/tests/cases/fourslash/completionsImport_ofAlias.ts b/tests/cases/fourslash/completionsImport_ofAlias.ts index 5808e6c9f1a..3951a93a57f 100644 --- a/tests/cases/fourslash/completionsImport_ofAlias.ts +++ b/tests/cases/fourslash/completionsImport_ofAlias.ts @@ -29,8 +29,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 - newFileContent: `import { foo } from "./a";\r -\r + newFileContent: `import { foo } from "./a"; + fo`, }); diff --git a/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts b/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts index b837b759b53..bc66d485877 100644 --- a/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts +++ b/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts @@ -24,8 +24,7 @@ verify.applyCodeActionFromCompletion("", { name: "foo", source: "/foo/lib/foo", description: `Import 'foo' from module "./foo"`, - // TODO: GH#18445 - newFileContent: `import { foo } from "./foo";\r -\r + newFileContent: `import { foo } from "./foo"; + fo`, }); diff --git a/tests/cases/fourslash/completionsImport_require.ts b/tests/cases/fourslash/completionsImport_require.ts index 2355cd06c33..c1830b726a1 100644 --- a/tests/cases/fourslash/completionsImport_require.ts +++ b/tests/cases/fourslash/completionsImport_require.ts @@ -23,9 +23,8 @@ verify.applyCodeActionFromCompletion("b", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 - newFileContent: `import { foo } from "./a";\r -\r + newFileContent: `import { foo } from "./a"; + const a = require("./a"); fo`, }); @@ -40,9 +39,8 @@ verify.applyCodeActionFromCompletion("c", { name: "foo", source: "/a", description: `Import 'foo' from module "./a"`, - // TODO: GH#18445 - newFileContent: `import { foo } from "./a";\r -\r + newFileContent: `import { foo } from "./a"; + const a = import("./a"); fo`, }); diff --git a/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts b/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts index ec2ae9b3c22..feead97486b 100644 --- a/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts +++ b/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts @@ -15,7 +15,7 @@ ////}); goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); goTo.marker("0"); // Won't-fixed: Smart indent during chained function calls verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts b/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts index b1955d98417..50cebb527ce 100644 --- a/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts +++ b/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts @@ -5,8 +5,8 @@ //// /*1*/ //// function foo(x: number, y: string): boolean {} -const noIndentScaffolding = "/**\r\n * \r\n * @param x\r\n * @param y\r\n */"; -const oneIndentScaffolding = "/**\r\n * \r\n * @param x\r\n * @param y\r\n */"; +const noIndentScaffolding = "/**\n * \n * @param x\n * @param y\n */"; +const oneIndentScaffolding = "/**\n * \n * @param x\n * @param y\n */"; const noIndentOffset = 8; const oneIndentOffset = noIndentOffset + 4; diff --git a/tests/cases/fourslash/findReferencesAfterEdit.ts b/tests/cases/fourslash/findReferencesAfterEdit.ts index 2d57e78c637..599be2255a3 100644 --- a/tests/cases/fourslash/findReferencesAfterEdit.ts +++ b/tests/cases/fourslash/findReferencesAfterEdit.ts @@ -15,6 +15,6 @@ verify.singleReferenceGroup("(property) A.foo: string"); goTo.marker(""); -edit.insert("\r\n"); +edit.insert("\n"); verify.singleReferenceGroup("(property) A.foo: string"); diff --git a/tests/cases/fourslash/formatEmptyBlock.ts b/tests/cases/fourslash/formatEmptyBlock.ts index 565dbc6257c..0521ab6c816 100644 --- a/tests/cases/fourslash/formatEmptyBlock.ts +++ b/tests/cases/fourslash/formatEmptyBlock.ts @@ -3,6 +3,6 @@ ////{} goTo.eof(); -edit.insert("\r\n"); +edit.insert("\n"); goTo.bof(); verify.currentLineContentIs("{ }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatTemplateLiteral.ts b/tests/cases/fourslash/formatTemplateLiteral.ts index a10f8dba8f2..6ec1ec3082e 100644 --- a/tests/cases/fourslash/formatTemplateLiteral.ts +++ b/tests/cases/fourslash/formatTemplateLiteral.ts @@ -15,10 +15,10 @@ goTo.marker("1"); -edit.insert("\r\n"); // edit will trigger formatting - should succeeed +edit.insert("\n"); // edit will trigger formatting - should succeeed goTo.marker("2"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(0); verify.currentLineContentIs("3`;") diff --git a/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts b/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts index 848f9943925..8304415ebfa 100644 --- a/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts +++ b/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts @@ -5,7 +5,7 @@ /////*4*/ i -= 2 /////*5*/ }/*1*/while (1 !== 1) goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); verify.currentLineContentIs("while (1 !== 1)"); goTo.marker("2"); verify.currentLineContentIs("do {"); diff --git a/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts b/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts index e35f4a333b9..2b5dc9a3a5c 100644 --- a/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts +++ b/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts @@ -7,7 +7,7 @@ /////*6*/}while(a!==b) /////*7*/}while(a!==b) goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); verify.currentLineContentIs(" {"); goTo.marker("2"); verify.currentLineContentIs("do{"); diff --git a/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts b/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts index e64c7be0492..40fc4a5934b 100644 --- a/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts +++ b/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts @@ -8,7 +8,7 @@ ////} goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); // We actually need to verify smart (virtual) identation here rather than actual identation. Fourslash support is required. verify.indentationIs(8); goTo.marker("2"); diff --git a/tests/cases/fourslash/getOccurrencesAfterEdit.ts b/tests/cases/fourslash/getOccurrencesAfterEdit.ts index 0654cc3962c..5514e22dce9 100644 --- a/tests/cases/fourslash/getOccurrencesAfterEdit.ts +++ b/tests/cases/fourslash/getOccurrencesAfterEdit.ts @@ -12,7 +12,7 @@ goTo.marker("1"); verify.occurrencesAtPositionCount(2); goTo.marker("0"); -edit.insert("\r\n"); +edit.insert("\n"); goTo.marker("1"); verify.occurrencesAtPositionCount(2); \ No newline at end of file diff --git a/tests/cases/fourslash/importNameCodeFixReExport.ts b/tests/cases/fourslash/importNameCodeFixReExport.ts index eb1c1a91343..c77d32cc458 100644 --- a/tests/cases/fourslash/importNameCodeFixReExport.ts +++ b/tests/cases/fourslash/importNameCodeFixReExport.ts @@ -10,8 +10,7 @@ ////x;|] goTo.file("/b.ts"); -// TODO:GH#18445 -verify.rangeAfterCodeFix(`import { x } from "./a";\r -\r +verify.rangeAfterCodeFix(`import { x } from "./a"; + export { x } from "./a"; x;`, /*includeWhiteSpace*/ true); diff --git a/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts b/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts index 06c0fb6e44a..a81bcb2f241 100644 --- a/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts +++ b/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts @@ -7,5 +7,5 @@ ////}; goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts b/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts index e7da28a2770..0bdd44f6753 100644 --- a/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts +++ b/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts @@ -14,7 +14,6 @@ verify.applicableRefactorAvailableAtMarker('1'); // NOTE: '// Comment' should be included, but due to incorrect handling of trivia, // it's omitted right now. -// TODO: GH#18445 verify.fileAfterApplyingRefactorAtMarker('1', `class fn {\r constructor() {\r diff --git a/tests/cases/fourslash/shims-pp/getOccurrencesAtPosition.ts b/tests/cases/fourslash/shims-pp/getOccurrencesAtPosition.ts index 0654cc3962c..5514e22dce9 100644 --- a/tests/cases/fourslash/shims-pp/getOccurrencesAtPosition.ts +++ b/tests/cases/fourslash/shims-pp/getOccurrencesAtPosition.ts @@ -12,7 +12,7 @@ goTo.marker("1"); verify.occurrencesAtPositionCount(2); goTo.marker("0"); -edit.insert("\r\n"); +edit.insert("\n"); goTo.marker("1"); verify.occurrencesAtPositionCount(2); \ No newline at end of file diff --git a/tests/cases/fourslash/shims/getOccurrencesAtPosition.ts b/tests/cases/fourslash/shims/getOccurrencesAtPosition.ts index 0654cc3962c..5514e22dce9 100644 --- a/tests/cases/fourslash/shims/getOccurrencesAtPosition.ts +++ b/tests/cases/fourslash/shims/getOccurrencesAtPosition.ts @@ -12,7 +12,7 @@ goTo.marker("1"); verify.occurrencesAtPositionCount(2); goTo.marker("0"); -edit.insert("\r\n"); +edit.insert("\n"); goTo.marker("1"); verify.occurrencesAtPositionCount(2); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentArrayBindingPattern01.ts b/tests/cases/fourslash/smartIndentArrayBindingPattern01.ts index 980f2383299..c16585f452d 100644 --- a/tests/cases/fourslash/smartIndentArrayBindingPattern01.ts +++ b/tests/cases/fourslash/smartIndentArrayBindingPattern01.ts @@ -4,7 +4,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentArrayBindingPattern02.ts b/tests/cases/fourslash/smartIndentArrayBindingPattern02.ts index b9a1da7796a..278c9ecf1ee 100644 --- a/tests/cases/fourslash/smartIndentArrayBindingPattern02.ts +++ b/tests/cases/fourslash/smartIndentArrayBindingPattern02.ts @@ -4,7 +4,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentDoStatement.ts b/tests/cases/fourslash/smartIndentDoStatement.ts index d121344bed0..144e04567be 100644 --- a/tests/cases/fourslash/smartIndentDoStatement.ts +++ b/tests/cases/fourslash/smartIndentDoStatement.ts @@ -7,7 +7,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentIfStatement.ts b/tests/cases/fourslash/smartIndentIfStatement.ts index 5a8c5014a77..a59b374be45 100644 --- a/tests/cases/fourslash/smartIndentIfStatement.ts +++ b/tests/cases/fourslash/smartIndentIfStatement.ts @@ -9,7 +9,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentInParenthesizedExpression01.ts b/tests/cases/fourslash/smartIndentInParenthesizedExpression01.ts index 253f58071d9..a3bed952e95 100644 --- a/tests/cases/fourslash/smartIndentInParenthesizedExpression01.ts +++ b/tests/cases/fourslash/smartIndentInParenthesizedExpression01.ts @@ -4,7 +4,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentObjectBindingPattern01.ts b/tests/cases/fourslash/smartIndentObjectBindingPattern01.ts index e10ef704c2c..a9bae4bbef5 100644 --- a/tests/cases/fourslash/smartIndentObjectBindingPattern01.ts +++ b/tests/cases/fourslash/smartIndentObjectBindingPattern01.ts @@ -4,7 +4,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentObjectBindingPattern02.ts b/tests/cases/fourslash/smartIndentObjectBindingPattern02.ts index 9247f5f467b..b4c751f58a1 100644 --- a/tests/cases/fourslash/smartIndentObjectBindingPattern02.ts +++ b/tests/cases/fourslash/smartIndentObjectBindingPattern02.ts @@ -4,7 +4,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentOnAccessors.ts b/tests/cases/fourslash/smartIndentOnAccessors.ts index a7972b1f48b..6176163a5fa 100644 --- a/tests/cases/fourslash/smartIndentOnAccessors.ts +++ b/tests/cases/fourslash/smartIndentOnAccessors.ts @@ -17,7 +17,7 @@ goTo.marker("0"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(8); goTo.marker("1"); verify.currentLineContentIs(" b,"); @@ -26,7 +26,7 @@ verify.currentLineContentIs(" //comment"); goTo.marker("3"); verify.currentLineContentIs(" c"); goTo.marker("4"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(8); goTo.marker("5"); verify.currentLineContentIs(" b,"); diff --git a/tests/cases/fourslash/smartIndentOnAccessors01.ts b/tests/cases/fourslash/smartIndentOnAccessors01.ts index a7972b1f48b..6176163a5fa 100644 --- a/tests/cases/fourslash/smartIndentOnAccessors01.ts +++ b/tests/cases/fourslash/smartIndentOnAccessors01.ts @@ -17,7 +17,7 @@ goTo.marker("0"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(8); goTo.marker("1"); verify.currentLineContentIs(" b,"); @@ -26,7 +26,7 @@ verify.currentLineContentIs(" //comment"); goTo.marker("3"); verify.currentLineContentIs(" c"); goTo.marker("4"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(8); goTo.marker("5"); verify.currentLineContentIs(" b,"); diff --git a/tests/cases/fourslash/smartIndentOnFunctionParameters.ts b/tests/cases/fourslash/smartIndentOnFunctionParameters.ts index 8823bf46917..1bc42fe2a67 100644 --- a/tests/cases/fourslash/smartIndentOnFunctionParameters.ts +++ b/tests/cases/fourslash/smartIndentOnFunctionParameters.ts @@ -12,7 +12,7 @@ //// 2/*7*/ ////] goTo.marker("0"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(4); goTo.marker("2"); verify.currentLineContentIs(" b,"); @@ -21,7 +21,7 @@ verify.currentLineContentIs(" //comment"); goTo.marker("4"); verify.currentLineContentIs(" c"); goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(4); goTo.marker("5"); verify.currentLineContentIs(" //comment"); diff --git a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration01.ts b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration01.ts index 3e08fe5975e..9ee221225e6 100644 --- a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration01.ts +++ b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration01.ts @@ -5,7 +5,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration02.ts b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration02.ts index 3de8b5ec6c3..f1e2d013c40 100644 --- a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration02.ts +++ b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration02.ts @@ -5,7 +5,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration03.ts b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration03.ts index 9a6c378f6ce..cb7aad0cc66 100644 --- a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration03.ts +++ b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration03.ts @@ -5,7 +5,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration04.ts b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration04.ts index 2cfd27f2e3b..73bd7d388c4 100644 --- a/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration04.ts +++ b/tests/cases/fourslash/smartIndentOnUnclosedFunctionDeclaration04.ts @@ -5,7 +5,7 @@ function verifyIndentationAfterNewLine(marker: string, indentation: number): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(indentation); } diff --git a/tests/cases/fourslash/smartIndentStartLineInLists.ts b/tests/cases/fourslash/smartIndentStartLineInLists.ts index 3410b4012ee..d61930ef511 100644 --- a/tests/cases/fourslash/smartIndentStartLineInLists.ts +++ b/tests/cases/fourslash/smartIndentStartLineInLists.ts @@ -4,5 +4,5 @@ ////}) goTo.marker("1"); -edit.insert("\r\n"); +edit.insert("\n"); verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentTemplateLiterals.ts b/tests/cases/fourslash/smartIndentTemplateLiterals.ts index 679978a515c..38b0252a01b 100644 --- a/tests/cases/fourslash/smartIndentTemplateLiterals.ts +++ b/tests/cases/fourslash/smartIndentTemplateLiterals.ts @@ -7,7 +7,7 @@ function verifyIndentation(marker: string): void { goTo.marker(marker); - edit.insert("\r\n"); + edit.insert("\n"); verify.indentationIs(0); } verifyIndentation("1");