topecongiro
f135641cc8
Use multi line when type bounds does not fit in a single line
2017-06-11 23:26:49 +09:00
topecongiro
27da80324c
Implement catch
2017-06-06 07:32:06 +02:00
est31
727963afe4
Update syntex_syntax
...
Bases on commit to switch to libsyntax by @nrc
2017-06-06 07:31:47 +02:00
Nick Cameron
6a9d7dab0d
Merge pull request #1637 from est31/master
...
Add config options for spaces around the colon in struct literal fields
2017-06-06 16:20:16 +12:00
Nick Cameron
450631ae67
Merge pull request #1633 from topecongiro/rfc/control-style
...
Do not add offset to match pattern when using Rfc style
2017-06-06 14:54:28 +12:00
est31
aa4cd311bb
Add config options for spaces around the colon in struct literal fields
...
In Rust, colons are used for three purposes:
* Type annotations, including type ascription
* Trait bounds
* Struct literal fields
This commit adds options for the last missing of the three purposes,
struct literal fields.
2017-06-06 03:50:58 +02:00
topecongiro
86be2e7bf8
Do not add offset to match pattern when using Rfc style
2017-06-05 17:57:43 +09:00
topecongiro
b49269ad39
Forbid method chain to get combined if it uses multi line.
...
If the method chain goes multi line before the last element, disallow combining
the method chain.
2017-06-04 19:37:24 +09:00
topecongiro
4a0094f28f
Add combine_control_expr option
2017-06-04 19:35:29 +09:00
topecongiro
b548d8d773
Refactor rewrite_call
2017-06-04 19:35:29 +09:00
topecongiro
a01ad30459
Forbid line break between if and pattern
2017-06-04 19:35:29 +09:00
topecongiro
aadd3e11f4
Unindent comment on top of else
2017-06-02 11:58:58 +09:00
Seiichi Uchida
5650411d64
Fix a typo
2017-06-02 11:20:49 +09:00
Nick Cameron
cdc3f9321c
Rename the Style::Default option to Legacy
2017-06-02 11:44:38 +12:00
Nick Cameron
0480f7e105
Merge pull request #1620 from topecongiro/rfc-if
...
Use correct line budget when using Rfc control style
2017-06-02 11:36:16 +12:00
topecongiro
fbd4b87329
Use correct one line budget when using Rfc control style
2017-06-01 19:59:50 +09:00
Seiichi Uchida
10c3632078
Format source codes
2017-06-01 12:08:25 +09:00
Seiichi Uchida
789abf063d
Use block indent style when visual indent failed
2017-06-01 12:08:20 +09:00
Nick Cameron
9b79cb5c22
Merge pull request #1602 from topecongiro/attributes-on-expressions
...
Allow attributes on expressions
2017-05-28 18:34:50 +12:00
topecongiro
99c2eab5ac
Allow attributes on expressions
2017-05-28 11:44:41 +09:00
Seiichi Uchida
a22228acee
Avoid unnecessary binary search in rewrite_call
2017-05-27 21:56:23 +09:00
topecongiro
554605d47c
Format source codes and add tests
2017-05-26 16:40:19 +09:00
topecongiro
15b988aed3
Allow macro to nested and overflowed like function call
2017-05-26 16:35:34 +09:00
topecongiro
b748fe8bec
Set inside_macro to false when rewriting args of macro
2017-05-26 16:34:58 +09:00
Nick Cameron
3d135ebba4
Merge pull request #1586 from topecongiro/minor
...
Fix minor bugs
2017-05-26 08:43:52 +12:00
Seiichi Uchida
92270ba191
Add offset when rewriting index
2017-05-25 23:01:41 +09:00
topecongiro
86856491bc
Format source codes
2017-05-25 16:08:08 +09:00
topecongiro
4d6e385f09
Refactoring: introduce one_line_budget
2017-05-25 15:50:46 +09:00
topecongiro
c8ad521c9f
Decide whether args fit in a single line inside rewrite_call_args
2017-05-25 06:10:00 +09:00
topecongiro
04bb5d8929
Format source codes
2017-05-24 00:07:02 +09:00
topecongiro
ec33121aaf
Format source codes
2017-05-23 22:13:29 +09:00
topecongiro
f83c22f24f
Add trailing comma to a single arg in multiline
2017-05-23 13:26:59 +09:00
topecongiro
b4cd9584b3
Implement combining for tuple and block
2017-05-23 12:51:32 +09:00
topecongiro
2c15204f0c
Update tests
2017-05-23 12:51:13 +09:00
topecongiro
29c0ab77ba
Implement combining openings and closings
2017-05-23 12:45:09 +09:00
topecongiro
dc8d3aa23a
Update tests
2017-05-23 11:39:31 +09:00
topecongiro
77a2e9858b
Format source codes
2017-05-23 11:37:33 +09:00
topecongiro
f2ec5a7bac
Refactor source codes
2017-05-23 11:37:12 +09:00
topecongiro
520340481d
Allow macro rewrite to fail on rhs
2017-05-23 11:37:12 +09:00
Michael Killough
c3c2e823cb
Merge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into config
2017-05-18 13:05:19 +07:00
topecongiro
d7b6f1199f
Format source codes
2017-05-16 23:24:38 +09:00
Michael Killough
c0bdbfa531
Switch to accessing config items via method.
...
Preparation for #865 , which proposes adding a flag which outputs which
config options are used during formatting.
This PR should not make any difference to functionality. A lot of this
was search-and-replace.
Some areas worthy of review/discussion:
- The method for each config item returns a clone of the underlying
value. We can't simply return an immutable reference, as lots of
places in the code expect to be able to pass the returned value as
`bool` (not `&bool). It would be nice if the `bool` items could
return a copy, but the more complex types a borrowed reference... but
unfortunately, I couldn't get the macro to do this.
- A few places (mostly tests and `src/bin/rustfmt.rs`) were overriding
config items by modifying the fields of the `Config` struct directly.
They now use the existing `override_value()` method, which has been
modified to return a `Result` for use by `src/bin/rustfmt.rs`. This
benefits of this are that the complex `file_lines` and `write_mode`
strings are now parsed in one place (`Config.override_value`) instead
of multiple. The disadvantages are that it moves the compile-time
checks for config names to become run-time checks.
2017-05-16 15:47:09 +07:00
Seiichi Uchida
762db5138e
Format source codes
2017-05-15 22:55:45 +09:00
Seiichi Uchida
79ba34c607
Use offset_left for rewrite_unary_prefix
2017-05-15 22:55:01 +09:00
Nick Cameron
ebb26db68b
Merge pull request #1551 from topecongiro/else-if-early-line-break
...
Forbid early line breaks inside else if
2017-05-15 08:59:03 +12:00
Seiichi Uchida
819a13030f
Use precise width when rewriting else if
2017-05-13 21:07:36 +09:00
Seiichi Uchida
7ec78711f2
Prevent rewriting closure block to expr inside macro
2017-05-13 18:32:25 +09:00
Seiichi Uchida
56515dd4d6
Merge pull request #1543 from topecongiro/field-attr
...
Support struct_field_attributes
2017-05-12 20:08:36 +09:00
topecongiro
744fa427e2
Support struct_field_attributes
2017-05-12 17:58:38 +09:00
topecongiro
384ce46eef
Use vertical layout when args len is larger than fn_call_width
2017-05-12 16:30:26 +09:00