Microsoft/TypeScript

Formatter fails to format uglified files

開放

#10,126 建立於 2016年8月4日

 (2 則留言) (0 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
Domain: FormatterHelp WantedSuggestionVS Code Tracked

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南