Skip to content

format on semicolon (onTypeFormatting) #99

@michaeldistel

Description

@michaeldistel

Summary

Implement textDocument/onTypeFormatting to auto-format the current line when the user types ; or END_*.

Scope

  • Trigger characters: ;, _ (catches END_IF, END_FOR, etc.)
  • Formats indentation of the current line only
  • Respects user formatting options (tab size, insert spaces)
  • Registered in LSP server capabilities

Implementation Notes

  • Add onTypeFormattingProvider to LSP capabilities in server.ts
  • Reuse indentation logic from FormattingProvider

Acceptance

  • Typing ; corrects indentation of current statement
  • Typing END_IF / END_FOR / END_WHILE normalizes indent
  • No formatting when triggered in comments or strings
  • Tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: LowenhancementNew feature or requestlspLanguage Server Protocol relatedv1.4.0Release 1.4.0v1.5.0Release 1.5.0

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions