Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Avoid parameter initializer and update baselines
  • Loading branch information
Andy Hanson committed Oct 23, 2018
commit f7df31949fa4487199d80bc1c6203a850dc2a524
4 changes: 2 additions & 2 deletions src/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,11 @@ namespace ts {
readonly indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean;
}

export function getDefaultFormatCodeSettings(newLineCharacter = "\n"): FormatCodeSettings {
export function getDefaultFormatCodeSettings(newLineCharacter?: string): FormatCodeSettings {
return {
indentSize: 4,
tabSize: 4,
newLineCharacter,
newLineCharacter: newLineCharacter || "\n",
convertTabsToSpaces: true,
indentStyle: IndentStyle.Smart,
insertSpaceAfterConstructor: false,
Expand Down
2 changes: 1 addition & 1 deletion src/testRunner/unittests/tsserverProjectSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6834,7 +6834,7 @@ namespace ts.projectSystem {
{
start: { line: 0, offset: 0 },
end: { line: 0, offset: 0 },
newText: "export const a = 0;",
newText: "export const a = 0;\n",
},
],
}
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ a; y;`,
"/y.ts":
`import { b } from './other';
import { p } from './a';
export const y: Date = p + b;`,
export const y: Date = p + b;
`,
},

preferences: {
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_bindingPatterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ verify.moveToNewFile({
"/a.ts": "",

"/x.ts":
`export const [x, { p: y }] = [0, { p: 1 }];`,
`export const [x, { p: y }] = [0, { p: 1 }];
`,

"/b.ts":
`
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_declarationKinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export namespace N {
}
export type T = number;
export interface I {
}`,
}
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_defaultExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ verify.moveToNewFile({
f();`,

"/f.ts":
`export default function f() { }`,
`export default function f() { }
`,

"/user.ts":
`import f from "./f";
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_defaultImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ verify.moveToNewFile({

"/x.ts":
`import f from "./a";
const x = f();`,
const x = f();
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_exportImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ M;`,

"/O.ts":
`import { N } from "./a";
export import O = N;`,
export import O = N;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ verify.moveToNewFile({
"/f.ts":
`function f() {
const x = 0;
}`,
}
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_getter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ verify.moveToNewFile({

"/g.ts":
`import { C } from "./a";
export const { g, h: i } = new C();`,
export const { g, h: i } = new C();
`,

"/b.ts":
`
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ verify.moveToNewFile({
`,

"/y.ts":
`const y = x;`,
`const y = x;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_importEquals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ verify.moveToNewFile({
j;`,
"/y.ts":
`import i = require("./i");
const y = i;`,
const y = i;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_inferQuoteStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { x } from './x';
x;`,

"/x.ts":
`export const x = 0;`,
`export const x = 0;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const { p } = require("./a");
const y = p + b;
exports.y = y;
const z = 0;
exports.z = 0;`,
exports.z = 0;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ verify.moveToNewFile({
``,

"/newFile.tsx":
`<div>a</div>;`,
`<div>a</div>;
`,
}
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_moveImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ b;`,
"/l.ts":
`import { a } from "m";
let l;
a;`,
a;
`,
}
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_multiple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ x; y;`,
export const x = 0;
a;
export const y = 1;
b;`,
b;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_namespaceImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ verify.moveToNewFile({
`export const y = 0;`,

"/x.ts":
`export const x = 0;`,
`export const x = 0;
`,

"/b.ts":
`import * as a from "./a";
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_newModuleNameUnique.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ verify.moveToNewFile({
``,

"/x.2.ts":
`export const x = 0;`,
`export const x = 0;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_onlyStatements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ verify.moveToNewFile({
`,

"/newFile.ts":
`console.log("goodbye");`,
`console.log("goodbye");
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_rangeSemiValid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ verify.moveToNewFile({
const y = 0;`,

"/x.ts":
`const x = 0;`,
`const x = 0;
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_selectionOnName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export {};
export function gee() { eff(); }`,
"/eff.ts":
`import { gee } from "./a";
export function eff() { gee(); }`,
export function eff() { gee(); }
`,
},
});
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ verify.moveToNewFile({
`,

"/src/newFile.ts":
`1;`,
`1;
`,

"/src/tsconfig.json":
`{
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_updateUses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ verify.moveToNewFile({
`,

"/y.ts":
`export const y = 0;`,
`export const y = 0;
`,

"/user.ts":
`import { x } from "./a";
Expand Down
3 changes: 2 additions & 1 deletion tests/cases/fourslash/moveToNewFile_updateUses_js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ verify.moveToNewFile({
`,

"/y.js":
`exports.y = 0;`,
`exports.y = 0;
`,

"/user.js":
// TODO: GH#22330
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export let x;

"/y.ts":
`import { x } from "./a";
const y = x;`,
const y = x;
`,
},
});