From 997fa7f0d33e94c8a80f5bdd0fe449cdd420ac2f Mon Sep 17 00:00:00 2001 From: Aiday Marlen Kyzy Date: Wed, 20 Mar 2024 17:57:12 +0100 Subject: [PATCH] adding one more test --- .../test/browser/indentation.test.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts b/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts index 83ea2a23d0f..2c987a5bfae 100644 --- a/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts +++ b/src/vs/editor/contrib/indentation/test/browser/indentation.test.ts @@ -565,6 +565,31 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => { }); }); + test.skip('issue #208215: outdented after semicolon detected after arrow function', () => { + + // Notes: we want to outdent after having detected a semi-colon which marks the end of the line, but only when we have detected an arrow function + // We want to have one outdent pattern corresponding to an indent pattern, and not a generic outdent and indent pattern + + const model = createTextModel([ + 'const add1 = (n) =>', + ' console.log("hi");', + ].join('\n'), languageId, {}); + disposables.add(model); + + withTestCodeEditor(model, { autoIndent: "full" }, (editor, viewModel, instantiationService) => { + + registerLanguage(instantiationService, languageId, Language.TypeScript, disposables); + + editor.setSelection(new Selection(2, 24, 2, 24)); + viewModel.type("\n", 'keyboard'); + assert.strictEqual(model.getValue(), [ + 'const add1 = (n) =>', + ' console.log("hi");', + '', + ].join('\n')); + }); + }); + test.skip('issue #116843: indent after arrow function', () => { // https://github.com/microsoft/vscode/issues/116843