diff options
Diffstat (limited to 'crates/ra_ide/src/typing')
-rw-r--r-- | crates/ra_ide/src/typing/on_enter.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ra_ide/src/typing/on_enter.rs index 6bcf2d72b..30c8c5572 100644 --- a/crates/ra_ide/src/typing/on_enter.rs +++ b/crates/ra_ide/src/typing/on_enter.rs | |||
@@ -7,7 +7,7 @@ use ra_syntax::{ | |||
7 | ast::{self, AstToken}, | 7 | ast::{self, AstToken}, |
8 | AstNode, SmolStr, SourceFile, | 8 | AstNode, SmolStr, SourceFile, |
9 | SyntaxKind::*, | 9 | SyntaxKind::*, |
10 | SyntaxToken, TextUnit, TokenAtOffset, | 10 | SyntaxToken, TextSize, TokenAtOffset, |
11 | }; | 11 | }; |
12 | use ra_text_edit::TextEdit; | 12 | use ra_text_edit::TextEdit; |
13 | 13 | ||
@@ -28,7 +28,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour | |||
28 | 28 | ||
29 | let prefix = comment.prefix(); | 29 | let prefix = comment.prefix(); |
30 | let comment_range = comment.syntax().text_range(); | 30 | let comment_range = comment.syntax().text_range(); |
31 | if position.offset < comment_range.start() + TextUnit::of_str(prefix) { | 31 | if position.offset < comment_range.start() + TextSize::of(prefix) { |
32 | return None; | 32 | return None; |
33 | } | 33 | } |
34 | 34 | ||
@@ -39,7 +39,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour | |||
39 | 39 | ||
40 | let indent = node_indent(&file, comment.syntax())?; | 40 | let indent = node_indent(&file, comment.syntax())?; |
41 | let inserted = format!("\n{}{} ", indent, prefix); | 41 | let inserted = format!("\n{}{} ", indent, prefix); |
42 | let cursor_position = position.offset + TextUnit::of_str(&inserted); | 42 | let cursor_position = position.offset + TextSize::of(&inserted); |
43 | let edit = TextEdit::insert(position.offset, inserted); | 43 | let edit = TextEdit::insert(position.offset, inserted); |
44 | 44 | ||
45 | Some( | 45 | Some( |