mirror of
https://github.com/Microsoft/vscode
synced 2024-07-05 01:08:57 +00:00
Merge pull request #208319 from microsoft/local-quail
Indent on enter from within [], {}, ()
This commit is contained in:
commit
b0725d3bf2
|
@ -218,6 +218,33 @@
|
|||
"action": {
|
||||
"indent": "outdent"
|
||||
}
|
||||
}
|
||||
},
|
||||
// Indent when pressing enter from inside ()
|
||||
{
|
||||
"beforeText": "^.*\\([^\\)]*$",
|
||||
"afterText": "^\\s*\\).*$",
|
||||
"action": {
|
||||
"indent": "indentOutdent",
|
||||
"appendText": "\t",
|
||||
}
|
||||
},
|
||||
// Indent when pressing enter from inside {}
|
||||
{
|
||||
"beforeText": "^.*\\{[^\\}]*$",
|
||||
"afterText": "^\\s*\\}.*$",
|
||||
"action": {
|
||||
"indent": "indentOutdent",
|
||||
"appendText": "\t",
|
||||
}
|
||||
},
|
||||
// Indent when pressing enter from inside []
|
||||
{
|
||||
"beforeText": "^.*\\[[^\\]]*$",
|
||||
"afterText": "^\\s*\\].*$",
|
||||
"action": {
|
||||
"indent": "indentOutdent",
|
||||
"appendText": "\t",
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
@ -874,7 +874,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
|
||||
|
||||
|
|
|
@ -40,4 +40,22 @@ export const javascriptOnEnterRules = [
|
|||
beforeText: /^\s+([^{i\s]|i(?!f\b))/,
|
||||
action: { indentAction: IndentAction.Outdent }
|
||||
},
|
||||
// Indent when pressing enter from inside ()
|
||||
{
|
||||
beforeText: /^.*\([^\)]*$/,
|
||||
afterText: /^\s*\).*$/,
|
||||
action: { indentAction: IndentAction.IndentOutdent, appendText: '\t' }
|
||||
},
|
||||
// Indent when pressing enter from inside {}
|
||||
{
|
||||
beforeText: /^.*\{[^\}]*$/,
|
||||
afterText: /^\s*\}.*$/,
|
||||
action: { indentAction: IndentAction.IndentOutdent, appendText: '\t' }
|
||||
},
|
||||
// Indent when pressing enter from inside []
|
||||
{
|
||||
beforeText: /^.*\[[^\]]*$/,
|
||||
afterText: /^\s*\].*$/,
|
||||
action: { indentAction: IndentAction.IndentOutdent, appendText: '\t' }
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue
Block a user