Nick Cameron
488e6fda12
Remove some unnecessary pub
s
2018-06-19 14:36:50 +12:00
Nick Cameron
261238ea51
Change use_small_heuristics
to an enum and stabilise
...
Since it is now an enum, we can be future compatible since we can add variants
for different heuristics.
Closes #1974
2018-06-19 13:28:27 +12:00
Seiichi Uchida
0ec1533054
Merge pull request #2779 from thibaultdelor/stableApi
...
Improve end lines handling
2018-06-11 11:38:26 +09:00
Tibo Delor
2e90c4314c
Stop delaying Trailing whitespace error reporting
2018-06-10 14:19:09 +10:00
Tibo Delor
42efae5944
Clean Up code where last whitspace tracking isn't used
2018-06-10 14:07:33 +10:00
Tibo Delor
6b00b8b302
Move newline logic inside the formatting process.
...
Why?:
- Conceptually it sounds right
- Absolutely all write modes where doing it anyway
- It was done several times in some in case
- It greatly simplify the code
2018-06-10 00:25:47 +10:00
Tibo Delor
8c32a9d909
Parse Error return an Error instead of a successful empty response
2018-06-10 00:25:06 +10:00
Nick Cameron
34067a1c4c
Merge pull request #2775 from topecongiro/macro-def-with-complex-macro
...
Change format_snippet to return None when it has failed to format macro call
2018-06-08 08:50:35 +12:00
Seiichi Uchida
19054347ca
Fix test failures
2018-06-07 15:20:01 +09:00
Seiichi Uchida
c95fa8cbe2
Return None when the formatting of macro failed in format_snippet
2018-06-07 12:33:33 +09:00
Seiichi Uchida
d1477ca1de
Add a field in Summary for notiyfing about formatting failure of macro
2018-06-07 12:32:58 +09:00
Seiichi Uchida
94e68b1eb6
Set the flag in RewriteContext when rewriting macro call failed
2018-06-07 12:32:10 +09:00
csmoe
c791a54ff4
repair break_label format
2018-06-07 11:21:52 +08:00
Nick Cameron
da30d235a4
Merge pull request #2771 from topecongiro/issue-2746
...
Fix poor formatting of impls
2018-06-06 14:38:42 +12:00
Nick Cameron
576e9af0ae
Merge pull request #2769 from topecongiro/issue-2765
...
Put each nested import on its own line
2018-06-06 14:37:25 +12:00
Seiichi Uchida
a4db62368b
Respect empty_item_single_line config option when formatting empty impls
2018-06-06 10:55:25 +09:00
Seiichi Uchida
d51b99f5d7
Put the where clause next to the closing bracket only when it is not indented
2018-06-06 10:54:40 +09:00
Seiichi Uchida
2e4376d29c
Do not put where clause on a single with multi-lined type
2018-06-06 10:46:49 +09:00
Seiichi Uchida
8d01496c9e
Remove unreachable lines
2018-06-06 10:46:18 +09:00
Seiichi Uchida
42ab258757
Put each nested import on its own line
...
while putting non-nested imports on the same line as much as possible.
2018-06-05 19:58:44 +09:00
Nick Cameron
f545dfe95e
Fix tests
2018-06-05 20:58:02 +12:00
Nick Cameron
95b4978baa
Merge pull request #2767 from topecongiro/issue-2759
...
Fix breaking code block with `#` in doc comments
2018-06-05 20:28:32 +12:00
king6cong
56a3d039ce
update rustfmt flags that should work without targets
2018-06-05 15:43:48 +08:00
Seiichi Uchida
604764abe1
Trim custom comment prefix even when we failed to format code block
2018-06-05 15:58:14 +09:00
Seiichi Uchida
1b4778d0bc
Handle code block with indented escapce character
2018-06-05 15:57:49 +09:00
Seiichi Uchida
a70213b009
Trim custom comment prefixes from code block without closing backticks
2018-06-05 15:57:03 +09:00
Nick Cameron
d9149fb52e
Merge pull request #2741 from csmoe/where_brace
...
Remove newline in empty impl
2018-06-05 18:04:22 +12:00
Seiichi Uchida
b4987d848b
Allow using mixed layout with comments
2018-06-05 13:43:01 +09:00
csmoe
faa41168a9
format exceeded comments
2018-06-05 07:35:51 +08:00
csmoe
8874c95a00
recover suppressed comma
2018-06-04 19:10:09 +08:00
csmoe
0468c134f4
snuggle where
2018-05-31 18:33:45 +08:00
csmoe
8536c288f2
suppress and compress
2018-05-31 17:58:48 +08: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
Alex Butler
f390626778
Update rustc-ap-* -> 149 ( #2748 )
2018-05-30 08:22:49 +09:00
Alex Butler
cd925f0140
Add mercy for devs that run cargo test
without building
2018-05-29 00:38:47 +01:00
Alex Butler
5473c3fd92
Update rustc-ap-* -> 148
2018-05-28 23:41:08 +01:00
Nick Cameron
173ae0d7b9
0.8.2
2018-05-28 11:47:21 +12:00
Nick Cameron
d930617cbe
Make Range public
...
0.8.1
2018-05-28 11:30:58 +12:00
Nick Cameron
8674ab9a42
FIXME for <-
2018-05-28 11:15:15 +12:00
Nick Cameron
0a2ec411ae
Merge pull request #2739 from thibaultdelor/fixWindowsTest
...
Fix test failing on windows due to crlf
2018-05-28 10:13:09 +12:00
Nick Cameron
1d5da1011f
Merge pull request #2733 from topecongiro/issue-2727
...
Trim unnecessary whitespaces between a macro call and a semicolon
2018-05-28 10:12:23 +12:00
topecongiro
8fea1fcfe5
Add a comment to describe hack
2018-05-28 06:44:52 +09:00
Tibo
33a46581f7
Fix test failing on windows due to crlf
2018-05-27 03:20:02 +10:00
Pazzaz
f711078126
Seperate and optimize grapheme conditions
2018-05-24 21:32:01 +02:00
Pazzaz
a1d137116b
Avoid unnecessary comparisons with cur_end
2018-05-24 21:32:01 +02:00
topecongiro
eedd275cd9
Do not call format_missing_inner in a common case
...
We use `format_missing()` to extract a missing comment between a macro
(or alike) and a trailing semicolon. This commit just tries to avoid calling
`format_missing_inner` in the common case where there is no such comment.
This is a hack, ideally we should fix a possible bug in `format_missing_inner`
or refactor `visit_mac` and `rewrite_macro`, but this should suffice to fix the
issue.
2018-05-24 00:14:05 +09:00
topecongiro
5d067f16e0
Format code block with sharp prefix
...
by hiding lines with a leading `#` behind a custom comment.
2018-05-23 23:30:07 +09:00
topecongiro
f1974e2209
Handle code block in doc comment without rust prefix
2018-05-23 23:29:28 +09:00
Nick Cameron
353816c596
Merge pull request #2730 from topecongiro/issue-2704
...
Disallow combining a method call with prefix or suffix
2018-05-23 20:10:49 +12:00