Nick Cameron
829dbfabe9
Merge pull request #3028 from scampi/issue2973
...
Fix indent computation of a macro with braces.
2018-09-19 11:31:28 +12:00
Nick Cameron
2267c2cddc
Merge pull request #3001 from scampi/issue2977
...
propagate errors about failing to rewrite a macro
2018-09-19 10:43:21 +12:00
Stéphane Campinas
c3edf6d3a1
Fix indent computation of a macro with braces.
...
The leading whitespace of a multine string was taken into account when
computing the `min_prefix_space_width`, even if that line couldn't be
trimmed. The consequence is it was always shifting the macro's content
to the right.
2018-09-18 00:01:51 +02:00
Stéphane Campinas
1befc93ba0
implement Drop from FmtVisitor in order to simplify failures passing
2018-09-12 13:09:07 +02:00
Seiichi Uchida
e06f16a0a5
Cargo update
2018-09-11 13:52:46 +09:00
Stéphane Campinas
6f318e3cef
propagate errors about failing to rewrite a macro
2018-09-07 14:48:52 +02:00
Maximilian Roos
968affc3e0
final clippy changes
2018-09-01 16:32:38 -04:00
cad97
fc1909d311
Reformat
2018-08-23 17:14:19 -04:00
cad97
04d804c365
Rename CodeMap/FileMap to SourceMap/SourceFile
...
#2946
2018-08-23 17:10:46 -04:00
Seiichi Uchida
05a0c8140d
Update import path to ThinVec
2018-08-19 00:26:34 +09:00
Seiichi Uchida
b318e5a684
Increase the max width by tab width when using format_code_block
...
since the macro body will be surrounded by fn main block.
2018-08-16 07:49:55 +09:00
Seiichi Uchida
9a5a86164f
Reduce the max width by the width of indent
2018-08-16 07:49:55 +09:00
Seiichi Uchida
024c03e81b
Use builder pattern for ListFormatting
2018-08-03 22:13:20 +09:00
Seiichi Uchida
339fa20973
Veto converting delimiters inside nested macro
2018-07-25 08:58:37 +09:00
Seiichi Uchida
975b3753ba
Keep the inside macro context in nested macro call
2018-07-25 07:15:33 +09:00
Nick Cameron
df4fb8a05b
Reformatting after rebase
2018-07-24 15:49:35 +12:00
Nick Cameron
481e85cc58
formatting
2018-07-24 15:46:39 +12:00
Nick Cameron
79c5ee8b42
Add config options for formatting macro matchers and bodies
...
Closes #2753
2018-07-18 12:03:59 +12:00
Nick Cameron
486f8fd8e7
Fixup formatting of tests and source
2018-07-12 21:37:28 +12:00
topecongiro
5a3640da69
Return the trimmed original snippet when formatting macro def failed
2018-07-01 09:59:53 +09:00
Seiichi Uchida
3027c21371
Handle raw identifiers
2018-06-25 23:36:45 +09:00
Nick Cameron
87edd75ecf
TODO -> FIXME
...
Or just delete
Closes #25
2018-06-22 14:42:27 +12:00
Josh Chase
ee5ff2d9e8
Add flag to the ListFormatting struct for nested imports
2018-06-19 12:13:35 -04:00
Seiichi Uchida
19054347ca
Fix test failures
2018-06-07 15:20:01 +09:00
Seiichi Uchida
94e68b1eb6
Set the flag in RewriteContext when rewriting macro call failed
2018-06-07 12:32:10 +09:00
Seiichi Uchida
2f65852946
Do not insert spaces around braces with empty body or multiple lines
2018-05-30 08:44:57 +09:00
Seiichi Uchida
966fe8d705
Fix treating the delimiter right after repeat as repeat as well
2018-05-30 08:44:57 +09:00
Nick Cameron
d726492e65
Remove spaces_within_parens_and_brackets
...
cc #1974
2018-05-18 16:35:09 +12:00
Shotaro Yamada
d1e2b80fb9
Use saturating_sub
2018-05-15 20:41:43 +09:00
Nick Cameron
4bbd5c4ae5
Merge pull request #2681 from topecongiro/issue-2680
...
Error on self_tests when there are lines that exceed max width
2018-05-07 11:20:33 +12:00
topecongiro
51c07f4335
Fix up lines exceeding max width
2018-05-06 16:17:09 +09:00
topecongiro
1f738ea208
Cargo fmt
2018-05-06 15:22:29 +09:00
csmoe
f7415bcea2
update self format
2018-04-29 20:53:31 +08:00
Seiichi Uchida
ac8ae00625
Cargo update and clippy ( #2643 )
2018-04-25 07:21:23 +09:00
csmoe
84d3659767
update rustc syntax 91.0.0
2018-04-08 22:22:11 +08:00
Seiichi Uchida
ec1907b2a4
Do not indent or unindent inside string literal
...
Closes #2588 .
2018-04-05 12:52:43 +09:00
Shotaro Yamada
89200f40ff
Remove unnecessary [..]
s
2018-04-01 22:29:26 +09:00
Seiichi Uchida
73e7235317
Cargo update ( #2575 )
...
Update `rustc-ap-syntax` to 82.0.0.
2018-03-30 17:52:09 +09:00
Seiichi Uchida
3de184fb0e
Merge pull request #2572 from codeworm96/remove_unreachable
...
Remove unreachable! from macros.rs
2018-03-29 09:16:38 +09:00
codeworm96
e68682f6db
Remove unreachable! from macros.rs
...
replaced unreachable! with error handling using Option.
Closes #2558
2018-03-28 23:38:34 +08:00
Nick Cameron
72b715bad4
Merge pull request #2571 from topecongiro/issue-2569
...
Avoid panicking on macro call with a single comma
2018-03-28 17:02:49 +02:00
Nick Cameron
8dd08ddd92
Merge pull request #2562 from topecongiro/issue-2196
...
Combine simple heuristics for function calls and array
2018-03-28 16:49:25 +02:00
Seiichi Uchida
a49e00b4d7
Avoid panicking on macro call with a single comma
...
`parse_item` from libsyntax may return `None`, so we need to discard
the result in that case.
2018-03-28 18:14:51 +09:00
rleungx
bf3bf8c235
allow underscore
2018-03-28 00:31:44 +08:00
Seiichi Uchida
98c6f7b731
Format array using overflow module
...
This commit applies heuristics used for function calls to array
and vice versa.
2018-03-26 07:36:44 +09:00
Seiichi Uchida
cf6c67e1a6
Replace MacroStyle with ast::DelimToken
2018-03-26 07:32:48 +09:00
Seiichi Uchida
903de92dae
Avoid cloning RewriteContext
2018-03-25 20:20:50 +09:00
Nick Cameron
2fbdedbf2f
Merge pull request #2549 from topecongiro/macro-def-spaces-around-colon
...
Add config option to control spaces around colon in macro def
2018-03-23 10:51:47 +13:00
topecongiro
ccec777f92
Cargo fmt and update tests
2018-03-22 16:09:21 +09:00
topecongiro
6115dcdbdc
Remove a space after a colon of metavariable def in macro def
2018-03-22 16:08:57 +09:00