Skip to content

Keepins same indentation if increaseIndentPattern is satisifed on line n and increaseNextLinePattern is satisfied on line n-1#213321

Closed
aiday-mar wants to merge 22 commits intomainfrom
silky-swan
Closed

Keepins same indentation if increaseIndentPattern is satisifed on line n and increaseNextLinePattern is satisfied on line n-1#213321
aiday-mar wants to merge 22 commits intomainfrom
silky-swan

Conversation

@aiday-mar
Copy link
Copy Markdown
Contributor

@aiday-mar aiday-mar commented May 23, 2024

fixes #209802

In relation to #43244

Screen.Recording.2024-05-30.at.12.06.04.mov

Please see #216500 for the PR, this PR is closed due to complicated merge

@aiday-mar aiday-mar self-assigned this May 23, 2024
@aiday-mar aiday-mar changed the title Keepins same indentation increaseIndentPattern is satisifed on line n and increaseNextLinePattern is satisfied on line n-1 Keepins same indentation if increaseIndentPattern is satisifed on line n and increaseNextLinePattern is satisfied on line n-1 May 30, 2024
@aiday-mar
Copy link
Copy Markdown
Contributor Author

After some thought, while this approach works for solving the issue of alman braces after a braceless if statement, it has unexpected consequences as seen inside of the failing tests.

A better approach would be to introduce the concept of previousPattern and currentPattern:

increaseIndentPattern: {
    previousPattern: Regex | null;
    currentPattern: Regex | null;
}

@aiday-mar aiday-mar closed this Jun 18, 2024
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong auto-indentation in typescript

1 participant