Microsoft/TypeScript

Formatter fails to format uglified files

Open

#10 126 ouverte le 4 août 2016

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Domain: FormatterHelp WantedSuggestionVS Code Tracked

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

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.

Guide contributeur