mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
refactor completions to use TextEdit instead of InsertText
This commit is contained in:
parent
fa43ef30f4
commit
d08e81cdd8
54 changed files with 2320 additions and 313 deletions
|
@ -337,7 +337,11 @@ pub fn handle_completion(
|
|||
None => return Ok(None),
|
||||
Some(items) => items,
|
||||
};
|
||||
let items = items.into_iter().map(|item| item.conv()).collect();
|
||||
let line_index = world.analysis().file_line_index(position.file_id);
|
||||
let items = items
|
||||
.into_iter()
|
||||
.map(|item| item.conv_with(&line_index))
|
||||
.collect();
|
||||
|
||||
Ok(Some(req::CompletionResponse::Array(items)))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue