diff --git a/editors/vscode/smoke.js b/editors/vscode/smoke.js index 657c55d..47ca36d 100644 --- a/editors/vscode/smoke.js +++ b/editors/vscode/smoke.js @@ -197,9 +197,11 @@ server.stdin.end( params: { textDocument: { uri }, options: { tabSize: 2, insertSpaces: true } }, }), // Multi-range formatting (LSP 3.18): two ranges, one round trip. Lines 2 - // and 8 of SOURCE (0-based 1 and 7) are `wire a;` and `initial fork`; only - // the first moves under `indent = 4`, so the answer proves both that the - // request is served and that it left the range between them alone. + // and 8 of SOURCE (0-based 1 and 7) are `wire a;` and `initial fork`. Each + // named block is laid out where it stands (selection formatting keeps a + // block's own leading whitespace): the wire is already laid out, the fork + // is re-laid under `indent = 4` from its two written spaces, and the + // `initial begin` between them keeps its bytes. frame({ jsonrpc: '2.0', id: 7, @@ -389,8 +391,11 @@ server.on('close', (code) => { fail(`expected one edit from rangesFormatting, got ${JSON.stringify(ranged.result)}`); } const partial = ranged.result[0].newText; - if (!partial.includes('\n wire a;')) { - fail(`the named line was not laid out:\n${partial}`); + if (!partial.includes('\n initial\n fork\n c = 1;\n join\n')) { + fail(`the named block was not laid out at its own indentation:\n${partial}`); + } + if (!partial.includes('\n wire a;')) { + fail(`a named line must keep the indentation it was written at:\n${partial}`); } if (!partial.includes('\n initial begin')) { fail(`a line no range named must keep its own bytes:\n${partial}`);