Skip to content

multi-line argument indentation #14596

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

Closed
WuTheFWasThat opened this issue Mar 11, 2017 · 1 comment
Closed

multi-line argument indentation #14596

WuTheFWasThat opened this issue Mar 11, 2017 · 1 comment
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Help Wanted You can do this
Milestone

Comments

@WuTheFWasThat
Copy link

WuTheFWasThat commented Mar 11, 2017

I've seen a number of indentation related bugs floating around but none quite like this. Not sure if this is fixed by #13574.

TypeScript Version: 2.2.1

Explanation

  public async setPosition(path: Path, col: Col, 
                           cursorOptions?: CursorOptions) {
    await this._setPath(path);
    await this.setCol(col, cursorOptions);
  }

  public async setPath(path: Path, cursorOptions?: CursorOptions) {
    await this._setPath(path);
    await this._fromMoveCol(cursorOptions);
  }

gets autoformatted to

  public async setPosition(path: Path, col: Col,
                           cursorOptions?: CursorOptions) {
                             await this._setPath(path);
                             await this.setCol(col, cursorOptions);
                           }

                           public async setPath(path: Path, cursorOptions?: CursorOptions) {
                             await this._setPath(path);
                             await this._fromMoveCol(cursorOptions);
                           }

If the arguments to setPosition are put on a single line, then it works fine.

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter labels Mar 13, 2017
@mhegazy mhegazy added this to the Community milestone Jan 4, 2018
@RyanCavanaugh RyanCavanaugh modified the milestones: Community, Backlog Mar 7, 2019
@rubiesonthesky
Copy link

rubiesonthesky commented Mar 10, 2024

This seems to format now to below code with VS Code Insiders with default settings.

    public async setPosition(path: Path, col: Col,
        cursorOptions?: CursorOptions) {
        await this._setPath(path);
        await this.setCol(col, cursorOptions);
    }

    public async setPath(path: Path, cursorOptions?: CursorOptions) {
        await this._setPath(path);
        await this._fromMoveCol(cursorOptions);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Formatter The issue relates to the built-in formatter Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants