mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
fix and add test
This commit is contained in:
parent
28fce55e1f
commit
f9592b6479
18
tests/cases/fourslash/formatOnEnterOpenBraceAddNewLine.ts
Normal file
18
tests/cases/fourslash/formatOnEnterOpenBraceAddNewLine.ts
Normal file
@ -0,0 +1,18 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
//// if(true) {/*0*/}
|
||||
//// if(false)/*1*/{
|
||||
//// }
|
||||
|
||||
format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true);
|
||||
goTo.marker("0");
|
||||
edit.insertLine("");
|
||||
goTo.marker("1");
|
||||
edit.insertLine("");
|
||||
verify.currentFileContentIs(
|
||||
`if (true)
|
||||
{
|
||||
}
|
||||
if (false)
|
||||
{
|
||||
}`);
|
||||
@ -3,12 +3,8 @@
|
||||
//// if(true)
|
||||
//// /**/
|
||||
|
||||
|
||||
format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", false);
|
||||
goTo.marker("");
|
||||
edit.insert("{");
|
||||
// TODO: figure out how to get rid of 3 extra spaces on second last line.
|
||||
verify.currentFileContentIs(
|
||||
`if (true) {`);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user