From 5d37ebcc02f6ca2ce1ced93f803dd1daf634d866 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 27 Oct 2026 14:00:49 +0000 Subject: feat(editor): support PP directives in VS Code and Bundle Share preprocessor highlighting through the existing grammar, keep conditional blocks at the ordinary indentation depth, and exercise switches in Bundle's native runner test. Co-Authored-By: Claude Opus 5.5 --- plugin/test/indentation.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugin/test/indentation.test.js') diff --git a/plugin/test/indentation.test.js b/plugin/test/indentation.test.js index 9140ed3..e71540f 100644 --- a/plugin/test/indentation.test.js +++ b/plugin/test/indentation.test.js @@ -82,3 +82,13 @@ test('escaped quotes keep block keywords inside literals masked', () => { 'THEN', String.raw`OUTPUT "escaped \" ENDIF //"`, 'ENDIF' ]), [0, 0, 1, 0]); }); + +test('preprocessor conditions preserve ordinary block depth without adding indentation', () => { + const lines = [ + 'PP_DEFINE Flag', 'PP_IFDEF Flag', 'PROCEDURE Demo()', 'PP_IFNDEF Other', + 'IF Ready THEN', 'OUTPUT 1', 'ENDIF', 'PP_ENDIF', 'PP_UNDEF Flag', + 'ENDPROCEDURE', 'PP_ENDIF' + ]; + assert.deepEqual(lineDepths(lines), [0, 0, 0, 1, 1, 2, 1, 1, 1, 0, 0]); + assert.deepEqual(indentationEdits(['PP_IFDEF Flag', 'OUTPUT 1', 'PP_ENDIF'], 0, 2), []); +}); -- cgit v1.3.1-4-g156e