aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assist_ctx.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/assist_ctx.rs')
-rw-r--r--crates/ra_assists/src/assist_ctx.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs
index 279163257..2fe7c3de3 100644
--- a/crates/ra_assists/src/assist_ctx.rs
+++ b/crates/ra_assists/src/assist_ctx.rs
@@ -5,7 +5,7 @@ use ra_fmt::{leading_indent, reindent};
5use ra_ide_db::RootDatabase; 5use ra_ide_db::RootDatabase;
6use ra_syntax::{ 6use ra_syntax::{
7 algo::{self, find_covering_element, find_node_at_offset}, 7 algo::{self, find_covering_element, find_node_at_offset},
8 AstNode, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextUnit, 8 AstNode, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxToken, TextRange, TextSize,
9 TokenAtOffset, 9 TokenAtOffset,
10}; 10};
11use ra_text_edit::TextEditBuilder; 11use ra_text_edit::TextEditBuilder;
@@ -178,7 +178,7 @@ impl<'a> AssistGroup<'a> {
178#[derive(Default)] 178#[derive(Default)]
179pub(crate) struct ActionBuilder { 179pub(crate) struct ActionBuilder {
180 edit: TextEditBuilder, 180 edit: TextEditBuilder,
181 cursor_position: Option<TextUnit>, 181 cursor_position: Option<TextSize>,
182 target: Option<TextRange>, 182 target: Option<TextRange>,
183 file: AssistFile, 183 file: AssistFile,
184} 184}
@@ -211,12 +211,12 @@ impl ActionBuilder {
211 } 211 }
212 212
213 /// Append specified `text` at the given `offset` 213 /// Append specified `text` at the given `offset`
214 pub(crate) fn insert(&mut self, offset: TextUnit, text: impl Into<String>) { 214 pub(crate) fn insert(&mut self, offset: TextSize, text: impl Into<String>) {
215 self.edit.insert(offset, text.into()) 215 self.edit.insert(offset, text.into())
216 } 216 }
217 217
218 /// Specify desired position of the cursor after the assist is applied. 218 /// Specify desired position of the cursor after the assist is applied.
219 pub(crate) fn set_cursor(&mut self, offset: TextUnit) { 219 pub(crate) fn set_cursor(&mut self, offset: TextSize) {
220 self.cursor_position = Some(offset) 220 self.cursor_position = Some(offset)
221 } 221 }
222 222