Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

wrong indent after formatting #8644

Copy link
Copy link
@jrieken

Description

@jrieken
Issue body actions

TypeScript Version:

1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)

Code

// A self-contained demonstration of the problem follows...
this._register('vscode.diff', (left: URI, right: URI, label: string) => {
    return this._commands.executeCommand('_workbench.diff', left, right, label);
}, {
    description: 'Opens the provided resources in the diff editor to compare their contents.',
    args: [
        { name: 'left', description: 'Uri of the resource for the left hand side of the diff editor', constraint: value => value instanceof URI },
        { name: 'right', description: 'Uri of the resource for the right hand side of the diff editor', constraint: value => value instanceof URI },
        { name: 'label', description: 'Label to use for the diff editor', constraint: value => typeof value === 'string' }
    ]
});

Expected behavior:

  • goto ts playground
  • paste the code and invoke format
  • you get this (note the wrong indent on the last 7 lines):
this._register('vscode.diff', (left: URI, right: URI, label: string) => {
    return this._commands.executeCommand('_workbench.diff', left, right, label);
}, {
        description: 'Opens the provided resources in the diff editor to compare their contents.',
        args: [
            { name: 'left', description: 'Uri of the resource for the left hand side of the diff editor', constraint: value => value instanceof URI },
            { name: 'right', description: 'Uri of the resource for the right hand side of the diff editor', constraint: value => value instanceof URI },
            { name: 'label', description: 'Label to use for the diff editor', constraint: value => typeof value === 'string' }
        ]
    });

Actual behavior:

indent properly

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterThe issue relates to the built-in formatterHelp WantedYou can do thisYou can do thisVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestoneCritical issues that VS Code needs fixed in the current TypeScript milestone

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.