Skip to content

[Test Plan Item] Add language configuration file for visual basic #290675

@dmitrivMS

Description

@dmitrivMS

Refs #118932

Complexity: 3

Create Issue


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

  1. Create/open a .vb file
  2. Set editor.autoIndent to full

Test 1: Block Statement Indentation (Increase)

Type a block-opening statement and press Enter:

If True Then↵
    |  ' cursor should be indented

Verify 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 If

Verify 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 indent

Test 4: onEnter After End Statements

Press Enter on a line after an End statement:

End If↵
|  ' cursor should NOT be additionally indented

Test 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 increase

Test 6: Case Insensitivity

Verify indentation works regardless of casing:

IF TRUE THEN
    ' indented
END IF  ' de-indented

Test 7: Comments After Statements

Block-opening keywords followed by comments should still indent:

If True Then ' comment↵
    |  ' should be indented

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions