Index: lib/Format/UnwrappedLineParser.cpp =================================================================== --- lib/Format/UnwrappedLineParser.cpp +++ lib/Format/UnwrappedLineParser.cpp @@ -1259,6 +1259,9 @@ nextToken(); } + if (FormatTok->is(tok::semi)) + return; + parseChildBlock(); } Index: unittests/Format/FormatTestJS.cpp =================================================================== --- unittests/Format/FormatTestJS.cpp +++ unittests/Format/FormatTestJS.cpp @@ -377,6 +377,12 @@ "declare function\n" "x();", // TODO(martinprobst): should ideally be indented. NineCols); + verifyFormat("declare function foo();\n" + "let x = 1;\n"); + verifyFormat("declare class X {}\n" + "let x = 1;\n"); + verifyFormat("declare interface Y {}\n" + "let x = 1;\n"); verifyFormat( "declare enum X {\n" "}",