Microsoft/TypeScript

Formatter fails to format uglified files

Open

#10.126 aperta il 4 ago 2016

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)TypeScript (6726 fork)batch import
Domain: FormatterHelp WantedSuggestionVS Code Tracked

Metriche repository

Star
 (48.455 star)
Metriche merge PR
 (Merge medio 6g 17h) (9 PR mergiate in 30 g)

Descrizione

TypeScript Version: 1.8.10

I use vscode from the Command Palette to format a javascript file uglified by uglify-js, but it failed. It not format code correctly, and only format partially.

source file 2016-07-12 4 47 08

sublime jsFormat formated 2016-07-12 4 47 29

vscode formated 2016-07-12 4 47 45

You see, It seems like, vscode only add some spaces around brackets, letters, commas etc.

See https://github.com/Microsoft/vscode/issues/8914#issuecomment-231978337 and the discussion below for more details. The provided traces clearly show that the tsserver only returns white space (" ") changes. No insertion of new lines.

Guida contributor