mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Simplify CompletionContext by introducing a path CallKind enum
This commit is contained in:
parent
ad9234fef2
commit
e475bcdcc6
6 changed files with 49 additions and 32 deletions
|
@ -4,7 +4,7 @@ use hir::Semantics;
|
|||
use ide_db::RootDatabase;
|
||||
use syntax::{
|
||||
algo::non_trivia_sibling,
|
||||
ast::{self, LoopBodyOwner},
|
||||
ast::{self, ArgListOwner, LoopBodyOwner},
|
||||
match_ast, AstNode, Direction, SyntaxElement,
|
||||
SyntaxKind::*,
|
||||
SyntaxNode, SyntaxToken, TextRange, TextSize, T,
|
||||
|
@ -39,6 +39,7 @@ pub(crate) enum ImmediateLocation {
|
|||
// Original file ast node
|
||||
MethodCall {
|
||||
receiver: Option<ast::Expr>,
|
||||
has_parens: bool,
|
||||
},
|
||||
// Original file ast node
|
||||
FieldAccess {
|
||||
|
@ -204,6 +205,7 @@ pub(crate) fn determine_location(
|
|||
.receiver()
|
||||
.map(|e| e.syntax().text_range())
|
||||
.and_then(|r| find_node_with_range(original_file, r)),
|
||||
has_parens: it.arg_list().map_or(false, |it| it.l_paren_token().is_some())
|
||||
},
|
||||
_ => return None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue