refactor completions to use TextEdit instead of InsertText

This commit is contained in:
gfreezy 2019-01-19 22:02:50 +08:00
parent fa43ef30f4
commit d08e81cdd8
54 changed files with 2320 additions and 313 deletions

View file

@ -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)))
}