Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider actual indentation of previous line for smart indent #8307

Merged
merged 7 commits into from
Dec 15, 2023

Commits on Dec 3, 2023

  1. Implement relative indent queries,

    i.e. also take into account the indentation of a previous
    line when computing the indentation for a new line.
    Triton171 committed Dec 3, 2023
    Configuration menu
    Copy the full SHA
    2f57364 View commit details
    Browse the repository at this point in the history
  2. Improve relative indent computation.

    Add tests to ensure that relative & absolute indent computation are consistent.
    Triton171 committed Dec 3, 2023
    Configuration menu
    Copy the full SHA
    ac68b98 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7de6353 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0a0fca4 View commit details
    Browse the repository at this point in the history
  5. Align arguments in a function call in C.

    Since the tree-sitter grammar is not very good
    at parsing function calls while they're being written,
    this is not yet super useful.
    However, it prevents the new `hybrid` indent heuristic
    from choosing these lines as a baseline, making it
    more robust.
    Triton171 committed Dec 3, 2023
    Configuration menu
    Copy the full SHA
    bedc472 View commit details
    Browse the repository at this point in the history
  6. Simplify implementation of add_indent_level.

    Increase hybrid indent heuristic attempt limit to 4.
    Clarify the fallback logic in indent heuristic docs.
    Triton171 committed Dec 3, 2023
    Configuration menu
    Copy the full SHA
    82bb431 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    bf311ec View commit details
    Browse the repository at this point in the history