adding rules to indent from within [], (), {}

This commit is contained in:
Aiday Marlen Kyzy
2024-03-21 17:30:16 +01:00
parent b40321263d
commit d8a989efdd
2 changed files with 29 additions and 2 deletions

View File

@@ -218,6 +218,33 @@
"action": { "action": {
"indent": "outdent" "indent": "outdent"
} }
} },
// Indent when pressing enter from inside ()
{
"beforeText": "^.*\\([^\\)]*$",
"afterText": "^[^\\(]*\\).*$",
"action": {
"indent": "indentOutdent",
"appendText": "\t",
}
},
// Indent when pressing enter from inside {}
{
"beforeText": "^.*\\{[^\\}]*$",
"afterText": "^[^\\{]*\\}.*$",
"action": {
"indent": "indentOutdent",
"appendText": "\t",
}
},
// Indent when pressing enter from inside []
{
"beforeText": "^.*\\[[^\\]]*$",
"afterText": "^[^\\[]*\\].*$",
"action": {
"indent": "indentOutdent",
"appendText": "\t",
}
},
] ]
} }

View File

@@ -838,7 +838,7 @@ suite('`Full` Auto Indent On Type - TypeScript/JavaScript', () => {
}); });
}); });
test.skip('issue #43244: indent when lambda arrow function is detected, outdent when end is reached', () => { test('issue #43244: indent when lambda arrow function is detected, outdent when end is reached', () => {
// https://github.com/microsoft/vscode/issues/43244 // https://github.com/microsoft/vscode/issues/43244