Nick Cameron
0fae34dfa1
Don't ignore universal quantification in function types
...
Fixes #1006
2016-05-27 15:09:04 -07:00
Marcus Klaas
eae2921e14
Bootstrap it. Hard.
2016-05-12 21:50:43 +02:00
Aaron Gallagher
96d59366fc
Don't misplace the :: on associated items.
...
The rewritten location of the :: on global paths for qpaths was wrong.
2016-05-02 17:11:22 -07:00
Nick Cameron
a9c3108c9c
Change defaults and update tests and source
...
New defaults are `Tabbed` for `chain_indent` and `chain_base_indent`, and `5` for `closure_block_indent_threshold`.
2016-04-22 19:18:48 +12:00
Marcus Klaas
f364a7ec43
Add option to force explicit extern ABI's
2016-04-18 18:39:40 +02:00
Nick Cameron
eadc878de0
Handle variadic function types
...
Closes #842
2016-04-12 10:47:35 +12:00
Nick Cameron
afc8be1d79
Change the logic around breaking multiple patterns in match arms
...
Refactor to use the list code, don't preserve original stacking-ness, base vertical vs mixed formatting on complexity of the patterns.
Closes #386
2016-04-12 09:23:37 +12:00
Marcus Klaas
0142191e51
Remove trailing whitespace for fn types /w non-unit return
2016-03-27 20:40:23 +02:00
Nick Cameron
da65090050
Merge pull request #857 from kamalmarhubi/codemap-ext
...
utils: Add CodeMapExt extension trait for span_* methods
2016-03-14 18:00:51 +13:00
Kamal Marhubi
d82d9fc808
utils: Add CodeMapSpanUtils trait for span_* methods
...
This commit adds a CodeMapSpanUtils extension trait on CodeMap, and
moves some functions to methods there:
- span_after
- span_after_last
- span_before
This better reflects them being lookup methods on the codemap.
2016-03-13 18:14:07 -04:00
Kamal Marhubi
589dabda2f
deps: Update syntex_syntax to 0.29.1
2016-03-02 13:08:21 -05:00
Vincent Esche
a0567d4063
Fix for issue #811 (falsely inserted "::" in paths with parameterized trait cast).
2016-03-01 16:39:43 +01:00
Connor Brewster
479b69266b
Changed TypeDensity::WhiteSpace to TypeDensity::Wide
...
Changed eq_str and plus_str assignments to use a match
2016-01-12 13:42:53 -07:00
Connor Brewster
dba2d8afd5
Added option for tighter punctuation in types. fixes #489
2016-01-11 12:26:57 -07:00
Manish Goregaokar
ffe9c9d834
Clippy rustfmt
2016-01-07 12:17:22 +05:30
Marcus Klaas
2069abcca4
Reduce dependency on pprust
2015-12-25 20:59:46 +01:00
Marcus Klaas
97e4e7e5ba
Fixed named arguments in bare function types
2015-12-06 01:11:26 +01:00
Nick Cameron
e3f39941de
Types which can be return types for function types
...
Fixes #643
2015-11-23 13:55:53 +13:00
Nick Cameron
9cf8529e33
Implement formatting for impls
...
Fixes #614
2015-11-23 13:09:00 +13:00
Marcus Klaas
840012b5e0
Format bare function types
...
Fix https://github.com/rust-lang-nursery/rustfmt/issues/616 .
Fix https://github.com/rust-lang-nursery/rustfmt/issues/276 .
Close https://github.com/rust-lang-nursery/rustfmt/issues/350 .
2015-11-22 16:07:38 +01:00
Marcus Klaas
559f00ba99
Fix up indentation of function style paths
...
Fixes https://github.com/rust-lang-nursery/rustfmt/issues/105 .
2015-11-22 14:48:30 +01:00
Marcus Klaas
1b0ae00488
Extract fn rewrite methods from RewriteVisitor
2015-11-22 13:45:51 +01:00
Marcus Klaas
6e1f77664d
Unwrap match arms that are simple blocks
2015-11-20 21:05:18 +01:00
Eli Friedman
2fff041b43
Pass in whether an ast::Path is in an expression context.
...
This gets rid of a slightly nasty hack involving scanning the source
expression for a ":".
2015-11-14 13:54:57 -08:00
Marcus Klaas
ca023ba9b7
Format some patterns
2015-10-19 20:15:36 +02:00
Marcus Klaas
01937061a9
Format more type variants
2015-10-17 16:05:59 +02:00
Nick Cameron
aed558fce4
Handle multi-line return types and multi-line tuples
...
Closes #409
2015-10-10 14:55:31 +13:00
Marcus Klaas
199d40fa55
Increase default function call width limit
2015-10-06 22:27:11 +02:00
Marcus Klaas
a76df6b4d9
Make listItem contain option
2015-10-04 20:40:14 +02:00
Marcus Klaas
965ea09664
Split ListTactic decision logic from write_list
2015-10-04 20:40:14 +02:00
Marcus Klaas de Vries
fff0be2f82
Merge pull request #402 from tikue/master
...
Fix 1-tuple regression.
2015-10-02 08:44:21 +02:00
Marcus Klaas de Vries
63860bb777
Merge pull request #378 from sinhpham/fix_376
...
Fix https://github.com/nrc/rustfmt/issues/376
2015-10-02 08:42:43 +02:00
Tim Kuehn
6c6e7194c2
Fix 1-tuple regression.
...
Add test to prevent future regressions.
2015-10-01 11:06:49 -07:00
Sinh Pham
11ed3c81d5
Fix https://github.com/nrc/rustfmt/issues/376
2015-09-30 23:43:56 -04:00
Sinh Pham
220ecdaf71
Fix https://github.com/nrc/rustfmt/issues/377
2015-09-27 17:03:48 -04:00
Marcus Klaas
431e8d9d2f
Remove a few unchecked subtractions, uses of ty_to_string
2015-09-27 17:56:38 +02:00
Nick Cameron
99d71a164a
Changes to source formatting
2015-09-26 13:58:12 +12:00
Nick Cameron
ebf64ca35d
Heuristic max width for function calls
2015-09-26 13:54:22 +12:00
Nick Cameron
92fbb80097
Formatting of some types
...
Closes #341
2015-09-26 13:48:02 +12:00
Pavel Sountsov
d4108a3029
Initial implementation of hard tab indentation.
2015-09-19 10:36:45 -07:00
Marcus Klaas
e72d488281
Refactor test code
...
No longer use callbacks or thread::catch_panic; reduce stdout spew; guard against rustfmt breaking the column limit.
2015-09-18 22:34:46 +02:00
Marcus Klaas
f751356910
Format macro invocations
2015-09-16 20:26:14 +02:00
Nick Cameron
a29023a191
Remove a few unnecessary rustfmt_skip
s
2015-09-15 11:46:27 +12:00
Marcus Klaas
03c660633f
Refine chain breaking heuristics
...
Don't make a single line chain when it is was multi line in the source; allow overflow of the last chain element onto the next lines without breaking the chain.
2015-09-11 00:53:01 +02:00
Marcus Klaas
a9814149c9
Align dots in chained expressions
2015-09-11 00:53:01 +02:00
Marcus Klaas
659c9b9037
Update indentation heuristics for single arg functions
2015-09-11 00:52:20 +02:00
Marcus Klaas
c680bb4030
Implement basic chain formatting
2015-09-11 00:52:16 +02:00
Marcus Klaas
f80dcbbd84
Split off binary search
2015-09-07 22:21:56 +02:00
Marcus Klaas
d05a41c773
Add failure mode to write_list
2015-09-07 20:35:25 +02:00
Marcus Klaas
c3cb348169
Fix qself rewrites without explicit casts
2015-09-06 23:18:27 +02:00