From d52ee59a712932bc381d8c690dc2f681598760fe Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 21 Jul 2019 13:28:58 +0300 Subject: streamline API --- crates/ra_assists/src/assist_ctx.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_assists/src') diff --git a/crates/ra_assists/src/assist_ctx.rs b/crates/ra_assists/src/assist_ctx.rs index 4d5a76de6..a12c3ed54 100644 --- a/crates/ra_assists/src/assist_ctx.rs +++ b/crates/ra_assists/src/assist_ctx.rs @@ -2,8 +2,9 @@ use hir::db::HirDatabase; use ra_db::FileRange; use ra_fmt::{leading_indent, reindent}; use ra_syntax::{ - algo::{find_covering_element, find_node_at_offset, find_token_at_offset, TokenAtOffset}, + algo::{find_covering_element, find_node_at_offset}, AstNode, SourceFile, SyntaxElement, SyntaxNode, SyntaxToken, TextRange, TextUnit, + TokenAtOffset, }; use ra_text_edit::TextEditBuilder; @@ -105,7 +106,7 @@ impl<'a, DB: HirDatabase> AssistCtx<'a, DB> { } pub(crate) fn token_at_offset(&self) -> TokenAtOffset { - find_token_at_offset(self.source_file.syntax(), self.frange.range.start()) + self.source_file.syntax().token_at_offset(self.frange.range.start()) } pub(crate) fn node_at_offset(&self) -> Option { -- cgit v1.2.3