mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Return more data about located imports
This commit is contained in:
parent
309421c117
commit
582cee2cdf
9 changed files with 172 additions and 125 deletions
|
@ -1534,14 +1534,13 @@ fn fill_resolve_data(
|
|||
position: &TextDocumentPositionParams,
|
||||
) -> Option<()> {
|
||||
let import_edit = item.import_to_add()?;
|
||||
let full_import_path = import_edit.import_path.to_string();
|
||||
let imported_name = import_edit.import_path.segments().last()?.to_string();
|
||||
let import_path = import_edit.import.import_path();
|
||||
|
||||
*resolve_data = Some(
|
||||
to_value(CompletionResolveData {
|
||||
position: position.to_owned(),
|
||||
full_import_path,
|
||||
imported_name,
|
||||
full_import_path: import_path.to_string(),
|
||||
imported_name: import_path.segments().last()?.to_string(),
|
||||
import_for_trait_assoc_item: import_edit.import_for_trait_assoc_item,
|
||||
})
|
||||
.unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue