Skip to content

Formatter dedents pasted union #38833

Closed
Closed

Description

@mjbvz

From Andy (Andrewkraft) (@Andy-MS) on July 11, 2017 22:10

TypeScript Version: nightly (2.5.0-dev.20170707)

Code

type T =
    | number
    | string;

Run "Format Document" and there is no change.
Cut this and paste it back, and it will be dedented to:

type T =
| number
| string;

Copied from original issue: microsoft/TypeScript#17108

Activity

  1. mjbvz commented on Nov 21, 2017

    @mjbvz
    ContributorAuthor

    From Mohamed Hegazy (@mhegazy) on November 20, 2017 23:0

    The cut+past issue seems to be VSCode specific. Matt Bierner (@mjbvz) do you have any insights here?

  2. added
    editor-autoindent
    and removed on Nov 21, 2017
  3. added
    bug
    typescript
    on Nov 21, 2017
  4. rebornix commented on Nov 28, 2017

    @rebornix
    Contributor

    #36294, #29896, #38833 share the same root cause: empty lines are not handled gracefully. I pushed a fix which makes this specific case work but it may not work for all cases ;)

  5. locked and limited conversation to collaborators on Jan 12, 2018
  6. added a commit that references this issue on Sep 6, 2026
    fcfc969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-autoindenttypescript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions