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

Formatter dedents pasted union #38833

Closed
mjbvz opened this issue Nov 21, 2017 · 2 comments
Closed

Formatter dedents pasted union #38833

mjbvz opened this issue Nov 21, 2017 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues typescript Typescript support issues

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Nov 21, 2017

From @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

@mjbvz mjbvz added the External label Nov 21, 2017
@mjbvz
Copy link
Contributor Author

mjbvz commented Nov 21, 2017

From @mhegazy on November 20, 2017 23:0

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

@mjbvz mjbvz added editor-autoindent Editor auto indentation issues and removed External labels Nov 21, 2017
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues labels Nov 21, 2017
@rebornix
Copy link
Member

#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 ;)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

2 participants