Mikko Rantanen
7be202fa3c
Add support for spaces_within_parens config ( #1187 )
...
* Add support for spaces_within_parens config
* Changes based on review comments
2016-10-13 14:34:08 +13:00
est31
efd3e5c091
Add three new options for spaces
2016-09-17 02:22:13 +02:00
Nick Cameron
4418fab4f2
Update to latest Syntex
...
+ Cargo update
+ 0.6.2 release
2016-09-16 15:28:02 +12:00
sinkuu
a3c63fdef9
Run clippy
2016-08-29 08:57:27 +09:00
Nathan Ridge
4b999a99c0
Add two new whitespace options ( #1109 )
...
* An option to leave a space before the colon in a type annotation
* An option to leave a space before the colon in a trait or lifetime bound
2016-08-03 01:11:39 -04:00
Jacob Clark
77edbb7def
Refactoring exsisting filter_maps to maps
2016-06-07 00:03:25 +01:00
Jacob Clark
2ea99869a7
Refactor string collects to itertools join
2016-06-06 22:30:40 +01:00
Kamal Marhubi
bd10af127e
utils: Move codemap related utilities to a dedicated module
...
This commit adds a `codemap` module, and moves the `CodemapSpanUtils`
added in #857 to it. This is preparation for adding more `Codemap`
specific utilities.
Refs #434
2016-05-31 00:49:26 +02:00
Nick Cameron
5436977bd5
Merge pull request #1017 from marcusklaas/tweak-if-else
...
Format non-statement if-else expressions on a single line
2016-05-31 01:57:29 +12:00
Kamal Marhubi
120e1a0b51
deps: Update syntex_syntax to 0.33
...
This bump brings syntex_syntax support for `..` in tuple and tuple
struct patterns, which come from RFC 1492:
https://github.com/rust-lang/rfcs/blob/master/text/1492-dotdot-in-patterns.md
These new patterns are not properly handled in this PR; instead #1021
tracks supporting them.
Refs #1021
2016-05-30 14:53:04 +02:00
Marcus Klaas
98c0570a28
Format non-statement if-else expressions on a single line
2016-05-29 17:58:38 +02:00
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