From 3ef7f8b778dce23af25965b379126b9dd95d1c27 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 14 Oct 2026 02:53:33 +0000 Subject: feat(plugin): indent try-catch blocks Indent TRY and CATCH bodies, align CATCH and ENDTRY with their TRY, and trigger on-type formatting when either keyword is completed. Document the supported blocks and verify nesting, selection context and Enter indentation. Co-Authored-By: Claude Fable 5.1 --- plugin/src/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugin/src/extension.js') diff --git a/plugin/src/extension.js b/plugin/src/extension.js index 70c8622..6bd1255 100644 --- a/plugin/src/extension.js +++ b/plugin/src/extension.js @@ -49,11 +49,11 @@ function activate(context) { }), vscode.languages.registerOnTypeFormattingEditProvider(languageId, { provideOnTypeFormattingEdits(document, position, char) { - if (char !== '\n' && !/^\s*(?:ELSE|ENDIF|ENDWHILE|UNTIL|NEXT|ENDFUNCTION|ENDPROCEDURE|ENDTYPE)\b/.test( + if (char !== '\n' && !/^\s*(?:ELSE|ENDIF|ENDWHILE|UNTIL|NEXT|ENDFUNCTION|ENDPROCEDURE|ENDTYPE|CATCH|ENDTRY)\b/.test( codeOnly(document.lineAt(position.line).text))) return []; return formatLines(document, position.line, position.line, char === '\n'); } - }, '\n', 'E', 'F', 'L', 'T', 'N') + }, '\n', 'E', 'F', 'L', 'T', 'N', 'H', 'Y') ); refreshBrackets(); } -- cgit v1.3.1-4-g156e