Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Creating new file from existing nodes should preserve newlines #53203

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

zardoy
Copy link
Contributor

@zardoy zardoy commented Mar 11, 2023

Fixes #44230

I tried to use workaround, because as I understand printer doesn't support printing node including leading trivia.

By the way I wonder why don't we always use sourceFile.getFullText() from old sourceFile? By doing this we can preserve node formatting (for example most devs prefer no indentation in switch-case), which we should do I think.

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

"Move to new file" removes line separators
4 participants