Add flag to hide code on inline suggestions

Now there's a way to add suggestions that hide the suggested code when
presented inline, to avoid weird wording when short code snippets are
added at the end.
This commit is contained in:
Esteban Küber
2017-07-16 11:43:24 -07:00
parent 7239d77171
commit faf90351b7
7 changed files with 32 additions and 7 deletions

View File

@@ -2807,9 +2807,9 @@ impl<'a> Parser<'a> {
let cur_pos = cm.lookup_char_pos(self.span.lo);
let op_pos = cm.lookup_char_pos(cur_op_span.hi);
if cur_pos.line != op_pos.line {
err.span_suggestion(cur_op_span,
"did you mean to end the statement here instead?",
";".to_string());
err.span_suggestion_short(cur_op_span,
"did you mean to use `;` here?",
";".to_string());
}
return Err(err);
}