SourceFile.formatText() seems to remove all blank lines
See original GitHub issueIf I add some blank lines using this.sourceFile.addStatements(writer => writer.newLine());
(no matter if at the end of the file or somewhere in the middle), and then call SourceFile.formatText()
, all the blank lines get removed.
It feels like it should leave the blank lines.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
createPrinter.printFile() should not remove empty lines #20506
printFile() to format the file, but not remove the empty lines inside ... formatText() seems to remove all blank lines dsherret/ts-morph#157.
Read more >Visual Studio Code - Remove blank lines from code
Click "Use Regular Expressions". In Find specify ^$\n . leave Replace as blank; Click "Replace All" All Blank lines will be deleted.
Read more >How Can I Remove All the Blank Lines from a Text File?
We then use this line of code – and the Trim function – to remove any blank spaces from the beginning and/or the...
Read more >How to remove empty lines in Visual Studio Code
Open your code in Visual Studio Code · From Edit Menu, select Replace or use a short cut key (command + Option +...
Read more >How to remove the blank line in informatica
Hi Experts, In my source,there is one blank line at the end of the file. ... the Source File Type from File to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in v2.0.0.
@Maximaximum btw, it’s the
languageService.getFormattingEditsForDocument
that does the job (so it is part of the compiler)