mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
be more careful with adding semis
This commit is contained in:
parent
f5de8212da
commit
e6ab53619b
@ -65,6 +65,9 @@ pub fn on_eq_typed(file: &File, offset: TextUnit) -> Option<ActionResult> {
|
||||
if contains_offset_nonstrict(expr_range, offset) && offset != expr_range.start() {
|
||||
return None;
|
||||
}
|
||||
if file.syntax().text().slice(offset..expr_range.start()).contains('\n') {
|
||||
return None;
|
||||
}
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
|
@ -99,3 +99,9 @@ impl SyntaxTextSlice for ops::RangeFrom<TextUnit> {
|
||||
Some(TextRange::from_to(self.start, range.end()))
|
||||
}
|
||||
}
|
||||
|
||||
impl SyntaxTextSlice for ops::Range<TextUnit> {
|
||||
fn restrict(&self, range: TextRange) -> Option<TextRange> {
|
||||
TextRange::from_to(self.start, self.end).restrict(range)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user