aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r--crates/ra_assists/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs
index ccc95735f..3ffbe4c51 100644
--- a/crates/ra_assists/src/lib.rs
+++ b/crates/ra_assists/src/lib.rs
@@ -19,7 +19,7 @@ pub mod ast_transform;
19 19
20use ra_db::{FileId, FileRange}; 20use ra_db::{FileId, FileRange};
21use ra_ide_db::RootDatabase; 21use ra_ide_db::RootDatabase;
22use ra_syntax::{TextRange, TextUnit}; 22use ra_syntax::{TextRange, TextSize};
23use ra_text_edit::TextEdit; 23use ra_text_edit::TextEdit;
24 24
25pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler}; 25pub(crate) use crate::assist_ctx::{Assist, AssistCtx, AssistHandler};
@@ -51,7 +51,7 @@ impl AssistLabel {
51#[derive(Debug, Clone)] 51#[derive(Debug, Clone)]
52pub struct AssistAction { 52pub struct AssistAction {
53 pub edit: TextEdit, 53 pub edit: TextEdit,
54 pub cursor_position: Option<TextUnit>, 54 pub cursor_position: Option<TextSize>,
55 // FIXME: This belongs to `AssistLabel` 55 // FIXME: This belongs to `AssistLabel`
56 pub target: Option<TextRange>, 56 pub target: Option<TextRange>,
57 pub file: AssistFile, 57 pub file: AssistFile,
@@ -104,7 +104,7 @@ pub fn resolved_assists(db: &RootDatabase, range: FileRange) -> Vec<ResolvedAssi
104 .flat_map(|it| it.0) 104 .flat_map(|it| it.0)
105 .map(|it| it.into_resolved().unwrap()) 105 .map(|it| it.into_resolved().unwrap())
106 .collect::<Vec<_>>(); 106 .collect::<Vec<_>>();
107 a.sort_by_key(|it| it.action.target.map_or(TextUnit::from(!0u32), |it| it.len())); 107 a.sort_by_key(|it| it.action.target.map_or(TextSize::from(!0u32), |it| it.len()));
108 a 108 a
109} 109}
110 110