aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/diagnostics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/diagnostics.rs')
-rw-r--r--crates/ra_ide/src/diagnostics.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs
index e7e201709..a6b4c2c28 100644
--- a/crates/ra_ide/src/diagnostics.rs
+++ b/crates/ra_ide/src/diagnostics.rs
@@ -171,7 +171,7 @@ fn text_edit_for_remove_unnecessary_braces_with_self_in_use_statement(
171 if single_use_tree.path()?.segment()?.syntax().first_child_or_token()?.kind() == T![self] { 171 if single_use_tree.path()?.segment()?.syntax().first_child_or_token()?.kind() == T![self] {
172 let start = use_tree_list_node.prev_sibling_or_token()?.text_range().start(); 172 let start = use_tree_list_node.prev_sibling_or_token()?.text_range().start();
173 let end = use_tree_list_node.text_range().end(); 173 let end = use_tree_list_node.text_range().end();
174 let range = TextRange::from_to(start, end); 174 let range = TextRange::new(start, end);
175 return Some(TextEdit::delete(range)); 175 return Some(TextEdit::delete(range));
176 } 176 }
177 None 177 None
@@ -277,7 +277,7 @@ mod tests {
277 assert!( 277 assert!(
278 diagnostic.range.start() <= file_position.offset 278 diagnostic.range.start() <= file_position.offset
279 && diagnostic.range.end() >= file_position.offset, 279 && diagnostic.range.end() >= file_position.offset,
280 "diagnostic range {} does not touch cursor position {}", 280 "diagnostic range {:?} does not touch cursor position {:?}",
281 diagnostic.range, 281 diagnostic.range,
282 file_position.offset 282 file_position.offset
283 ); 283 );
@@ -603,7 +603,7 @@ mod tests {
603 [ 603 [
604 Diagnostic { 604 Diagnostic {
605 message: "unresolved module", 605 message: "unresolved module",
606 range: [0; 8), 606 range: 0..8,
607 fix: Some( 607 fix: Some(
608 SourceChange { 608 SourceChange {
609 label: "create module", 609 label: "create module",
@@ -652,7 +652,7 @@ mod tests {
652 [ 652 [
653 Diagnostic { 653 Diagnostic {
654 message: "Missing structure fields:\n- b", 654 message: "Missing structure fields:\n- b",
655 range: [224; 233), 655 range: 224..233,
656 fix: Some( 656 fix: Some(
657 SourceChange { 657 SourceChange {
658 label: "fill struct fields", 658 label: "fill struct fields",
@@ -664,7 +664,7 @@ mod tests {
664 edit: TextEdit { 664 edit: TextEdit {
665 atoms: [ 665 atoms: [
666 AtomTextEdit { 666 AtomTextEdit {
667 delete: [3; 9), 667 delete: 3..9,
668 insert: "{a:42, b: ()}", 668 insert: "{a:42, b: ()}",
669 }, 669 },
670 ], 670 ],