mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Add flyimport completion for trait assoc items
This commit is contained in:
parent
9a349f280f
commit
db335a1bbf
18 changed files with 661 additions and 247 deletions
|
@ -139,6 +139,7 @@ pub fn resolve_completion_edits(
|
|||
position: FilePosition,
|
||||
full_import_path: &str,
|
||||
imported_name: String,
|
||||
import_for_trait_assoc_item: bool,
|
||||
) -> Option<Vec<TextEdit>> {
|
||||
let ctx = CompletionContext::new(db, position, config)?;
|
||||
let anchor = ctx.name_ref_syntax.as_ref()?;
|
||||
|
@ -154,7 +155,7 @@ pub fn resolve_completion_edits(
|
|||
})
|
||||
.find(|mod_path| mod_path.to_string() == full_import_path)?;
|
||||
|
||||
ImportEdit { import_path, import_scope }
|
||||
ImportEdit { import_path, import_scope, import_for_trait_assoc_item }
|
||||
.to_text_edit(config.insert_use.merge)
|
||||
.map(|edit| vec![edit])
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue