Seiichi Uchida
789abf063d
Use block indent style when visual indent failed
2017-06-01 12:08:20 +09:00
Seiichi Uchida
7ec78711f2
Prevent rewriting closure block to expr inside macro
2017-05-13 18:32:25 +09:00
Nick Cameron
b35906dbce
WIP
2017-02-21 16:35:05 +13:00
Nick Cameron
428339fdc3
Refactor indent and width into Shape struct
2017-01-31 08:35:23 +13:00
Nick Cameron
4c3228530f
block indent large closures
...
somewhat rough around the edges
2016-04-22 11:29:01 +12:00
Eli Friedman
1c235de97d
Fix crash speculatively parsing macro arguments as expressions.
...
The problem is essentially that if we try to parse a token tree using a
CodeMap different from the one the tree was originally parsed with,
spans become nonsense. Since CodeMaps can't be cloned, we're basically
forced to use the original ParseSess for additional parsing.
Ideally, rustfmt would be a bit more clever and figure out how to parse
macro arguments based on the definition of the macro itself, rather than
just guessing that a particular token sequence looks like an expression,
but this is good enough for now.
Fixes #538 .
2015-10-27 23:41:32 -07:00
Marcus Klaas
3970748f59
Remove overflow indentation
2015-10-19 23:06:36 +02:00
Pavel Sountsov
03e1b27826
Add Indent::none(), remove make_indent.
2015-09-19 10:36:45 -07:00
Pavel Sountsov
d4108a3029
Initial implementation of hard tab indentation.
2015-09-19 10:36:45 -07:00
Nick Cameron
183dac91a3
Fix a bug where struct lits nested in fn calls were over-indented
2015-09-02 15:36:17 +12:00
Nick Cameron
a5f8b37eeb
Format match expressions properly when they appear on an overflowing line.
2015-09-02 14:29:47 +12:00
Gaëtan Cassiers
5e445697ce
Implement Rewrite for [ast::Attribute]
2015-08-27 22:29:07 +02:00
Nick Cameron
dc2544712c
Rewrite match expressions
2015-08-20 08:08:11 +12:00
Marcus Klaas
b473c2bd2a
Format loops
2015-07-15 23:33:01 +02:00
Marcus Klaas
d7b49fd76c
Remove global mutable config to allow for concurrency
2015-06-23 13:26:04 +02:00
Gaëtan Cassiers
ad658885d4
Comments for Rewrite
2015-06-23 02:15:46 +02:00
Gaëtan Cassiers
c012d311c4
A basic impl of Rewrite for ast::Expr
2015-06-23 02:15:46 +02:00