diff options
Diffstat (limited to 'crates/ra_ide/src/syntax_tree.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_tree.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide/src/syntax_tree.rs b/crates/ra_ide/src/syntax_tree.rs index 5842ae2e8..a8a97a69f 100644 --- a/crates/ra_ide/src/syntax_tree.rs +++ b/crates/ra_ide/src/syntax_tree.rs | |||
@@ -5,7 +5,7 @@ use ra_ide_db::RootDatabase; | |||
5 | use ra_syntax::{ | 5 | use ra_syntax::{ |
6 | algo, AstNode, NodeOrToken, SourceFile, | 6 | algo, AstNode, NodeOrToken, SourceFile, |
7 | SyntaxKind::{RAW_STRING, STRING}, | 7 | SyntaxKind::{RAW_STRING, STRING}, |
8 | SyntaxToken, TextRange, TextUnit, | 8 | SyntaxToken, TextRange, TextSize, |
9 | }; | 9 | }; |
10 | 10 | ||
11 | pub use ra_db::FileId; | 11 | pub use ra_db::FileId; |
@@ -66,13 +66,13 @@ fn syntax_tree_for_token(node: &SyntaxToken, text_range: TextRange) -> Option<St | |||
66 | let len = len.min(node_len); | 66 | let len = len.min(node_len); |
67 | 67 | ||
68 | // Ensure our slice is inside the actual string | 68 | // Ensure our slice is inside the actual string |
69 | let end = if start + len < TextUnit::of_str(&text) { | 69 | let end = if start + len < TextSize::of(&text) { |
70 | start + len | 70 | start + len |
71 | } else { | 71 | } else { |
72 | TextUnit::of_str(&text) - start | 72 | TextSize::of(&text) - start |
73 | }; | 73 | }; |
74 | 74 | ||
75 | let text = &text[TextRange::from_to(start, end)]; | 75 | let text = &text[TextRange::new(start, end)]; |
76 | 76 | ||
77 | // Remove possible extra string quotes from the start | 77 | // Remove possible extra string quotes from the start |
78 | // and the end of the string | 78 | // and the end of the string |