-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Description
Refs #118932
- AnyOS @dbaeumer
- AnyOS @joshspicer
Complexity: 3
VB Language Spec:
https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/
Use various language constructs and verify auto-indentation works as expected.
Verify both formatting and Enter behavior after a line.
NOTES
- There will be edge cases as it's still regex based and not semantic
- Colorization is VB is broken in many cases due to very stale TextMate grammar
More detailed test plan is below.
Setup
- Create/open a
.vbfile - Set
editor.autoIndenttofull
Test 1: Block Statement Indentation (Increase)
Type a block-opening statement and press Enter:
If True Then↵
| ' cursor should be indentedVerify indent increases after statements like:
- Control flow:
If...Then,Else,ElseIf,Select Case,Case - Loops:
While,For,Do - Declarations:
Sub,Function,Class,Module,Property - Others:
Try,Catch,Finally,With,Using
Test 2: Block Statement Indentation (Decrease)
Type a closing statement and verify automatic de-indent:
If True Then
' some code
End If ' should align with IfVerify de-indent for:
End If,End Sub,End Function,End Class,End Module,End Select, etc.Else,ElseIf,Case,Catch,Finally- Loop terminators:
Loop,Next,Wend,Until
Test 3: Single-Line Statements (No Extra Indent)
Verify no indent increase when block opens and closes on same line:
If x = 1 Then Return End If↵
| ' cursor same level, no indentTest 4: onEnter After End Statements
Press Enter on a line after an End statement:
End If↵
| ' cursor should NOT be additionally indentedTest 5: onEnter on Blank Line After Block Terminators
After an End statement, press Enter on a blank line:
End Sub
↵ ' blank line, press Enter
| ' should maintain indentation, not increaseTest 6: Case Insensitivity
Verify indentation works regardless of casing:
IF TRUE THEN
' indented
END IF ' de-indentedTest 7: Comments After Statements
Block-opening keywords followed by comments should still indent:
If True Then ' comment↵
| ' should be indented