Skip to content

Improve syntax-aware auto indentation #61

Description

@CX330Blake

PR #59 adds lightweight auto indentation based on the current line and programming language. But the current implementation intentionally avoids syntax parsing, which leaves several cases that should be handled separately:

  • Python block statements with trailing comments:
    if ready: # explain
  • Delimiters inside trailing comments:
    run(); // setup {
  • Continuation lines inside multi-line block comments
    /*
     * comment
     * /
    
  • Code following a closed block comment on the same line:
    /* guard */ if (ready) {

A follow-up could introduce a dedicated language-aware helper instead of expanding the current regular expressions with more special cases.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions