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

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

Closed
wants to merge 22 commits into from

Conversation

aiday-mar
Copy link
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
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