mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 02:58:56 +01:00
Merge pull request #286341 from microsoft/dev/dmitriv/vb-indentation
Fix indentation rules for VB
This commit is contained in:
@@ -32,14 +32,14 @@
|
||||
"flags": "i"
|
||||
},
|
||||
"increaseIndentPattern": {
|
||||
"pattern": "^\\s*((If|ElseIf).*Then(?!\\s+(End\\s+If))\\s*(('|REM).*)?$)|\\b(Else|While|For|Do|Select\\s+Case|Case|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Try|Catch|Finally|SyncLock|Using|Property|Get|Set|AddHandler|RaiseEvent|RemoveHandler|Event|Operator)\\b(?!.*\\bEnd\\s+(If|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Select|Try|While|For|Property|Get|Set|SyncLock|Using|AddHandler|RaiseEvent|RemoveHandler|Event|Operator)\\b).*(('|REM).*)?$",
|
||||
"pattern": "^\\s*((If|ElseIf).*Then(?!.*End\\s+If)\\s*(('|REM).*)?|(Else|While|For|Do|Select\\s+Case|Case|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Try|Catch|Finally|SyncLock|Using|Property|Get|Set|AddHandler|RaiseEvent|RemoveHandler|Event|Operator)\\b(?!.*\\bEnd\\s+(If|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Select|Try|While|For|Property|Get|Set|SyncLock|Using|AddHandler|RaiseEvent|RemoveHandler|Event|Operator)\\b).*(('|REM).*)?)$",
|
||||
"flags": "i"
|
||||
}
|
||||
},
|
||||
"onEnterRules": [
|
||||
// Prevent indent after End statements, block terminators (Else, ElseIf, Loop, Next, etc.)
|
||||
// Prevent indent after End statements and block terminators (Loop, Next, etc.)
|
||||
{
|
||||
"beforeText": { "pattern": "^\\s*((End\\s+(If|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Select|Try|While|For|Property|Get|Set|SyncLock|Using|AddHandler|RaiseEvent|RemoveHandler|Event|Operator))|Else|ElseIf|Loop|Next|Wend|Until)\\b.*$", "flags": "i" },
|
||||
"beforeText": { "pattern": "^\\s*((End\\s+(If|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Select|Try|While|For|Property|Get|Set|SyncLock|Using|AddHandler|RaiseEvent|RemoveHandler|Event|Operator))|Loop|Next|Wend|Until)\\b.*$", "flags": "i" },
|
||||
"action": {
|
||||
"indent": "none"
|
||||
}
|
||||
@@ -47,15 +47,7 @@
|
||||
// Prevent indent when pressing Enter on a blank line after End statements or block terminators
|
||||
{
|
||||
"beforeText": "^\\s*$",
|
||||
"previousLineText": { "pattern": "^\\s*((End\\s+(If|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Select|Try|While|For|Property|Get|Set|SyncLock|Using|AddHandler|RaiseEvent|RemoveHandler|Event|Operator))|Else|ElseIf|Loop|Next|Wend|Until)\\b.*$", "flags": "i" },
|
||||
"action": {
|
||||
"indent": "none"
|
||||
}
|
||||
},
|
||||
// Prevent indent after lines ending with closing parenthesis (e.g., function calls, method invocations)
|
||||
{
|
||||
"beforeText": { "pattern": "^[^'\"]*\\)\\s*('.*)?$", "flags": "i" },
|
||||
"afterText": "^(?!\\s*\\))",
|
||||
"previousLineText": { "pattern": "^\\s*((End\\s+(If|Sub|Function|Class|Module|Enum|Structure|Interface|Namespace|With|Select|Try|While|For|Property|Get|Set|SyncLock|Using|AddHandler|RaiseEvent|RemoveHandler|Event|Operator))|Loop|Next|Wend|Until)\\b.*$", "flags": "i" },
|
||||
"action": {
|
||||
"indent": "none"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user