mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Complete associated types in dyn and impl trait
This commit is contained in:
parent
863e23f00f
commit
ec9ef9c283
4 changed files with 64 additions and 10 deletions
|
@ -47,6 +47,9 @@ pub(crate) enum ImmediateLocation {
|
|||
receiver_is_ambiguous_float_literal: bool,
|
||||
},
|
||||
// Original file ast node
|
||||
// Only set from a type arg
|
||||
GenericArgList(ast::GenericArgList),
|
||||
// Original file ast node
|
||||
/// The record expr of the field name we are completing
|
||||
RecordExpr(ast::RecordExpr),
|
||||
// Original file ast node
|
||||
|
@ -159,7 +162,6 @@ pub(crate) fn determine_location(
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
let res = match_ast! {
|
||||
match parent {
|
||||
ast::IdentPat(_it) => ImmediateLocation::IdentPat,
|
||||
|
@ -174,6 +176,9 @@ pub(crate) fn determine_location(
|
|||
Some(TRAIT) => ImmediateLocation::Trait,
|
||||
_ => return None,
|
||||
},
|
||||
ast::GenericArgList(_it) => sema
|
||||
.find_node_at_offset_with_macros(original_file, offset)
|
||||
.map(ImmediateLocation::GenericArgList)?,
|
||||
ast::Module(it) => {
|
||||
if it.item_list().is_none() {
|
||||
ImmediateLocation::ModDeclaration(it)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue