aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/assist_context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_assists/src/assist_context.rs')
-rw-r--r--crates/ide_assists/src/assist_context.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ide_assists/src/assist_context.rs b/crates/ide_assists/src/assist_context.rs
index 1482d37f8..8714e4978 100644
--- a/crates/ide_assists/src/assist_context.rs
+++ b/crates/ide_assists/src/assist_context.rs
@@ -13,7 +13,7 @@ use ide_db::{
13 RootDatabase, 13 RootDatabase,
14}; 14};
15use syntax::{ 15use syntax::{
16 algo::{self, find_node_at_offset, SyntaxRewriter}, 16 algo::{self, find_node_at_offset, find_node_at_range, SyntaxRewriter},
17 AstNode, AstToken, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxNodePtr, 17 AstNode, AstToken, SourceFile, SyntaxElement, SyntaxKind, SyntaxNode, SyntaxNodePtr,
18 SyntaxToken, TextRange, TextSize, TokenAtOffset, 18 SyntaxToken, TextRange, TextSize, TokenAtOffset,
19}; 19};
@@ -89,6 +89,9 @@ impl<'a> AssistContext<'a> {
89 pub(crate) fn find_node_at_offset<N: AstNode>(&self) -> Option<N> { 89 pub(crate) fn find_node_at_offset<N: AstNode>(&self) -> Option<N> {
90 find_node_at_offset(self.source_file.syntax(), self.offset()) 90 find_node_at_offset(self.source_file.syntax(), self.offset())
91 } 91 }
92 pub(crate) fn find_node_at_range<N: AstNode>(&self) -> Option<N> {
93 find_node_at_range(self.source_file.syntax(), self.frange.range)
94 }
92 pub(crate) fn find_node_at_offset_with_descend<N: AstNode>(&self) -> Option<N> { 95 pub(crate) fn find_node_at_offset_with_descend<N: AstNode>(&self) -> Option<N> {
93 self.sema.find_node_at_offset_with_descend(self.source_file.syntax(), self.offset()) 96 self.sema.find_node_at_offset_with_descend(self.source_file.syntax(), self.offset())
94 } 97 }