use a combination of source_change and text_edit for CompleteItem

This commit is contained in:
gfreezy 2019-01-20 12:02:00 +08:00
parent 94d96b60f3
commit 2a43638052
48 changed files with 305 additions and 295 deletions

View file

@ -17,7 +17,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
for (name, res) in module_scope.entries() {
CompletionItem::new(
CompletionKind::Reference,
ctx.leaf_range(),
ctx.source_range(),
name.to_string(),
)
.from_resolution(ctx, res)
@ -30,7 +30,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
.for_each(|(variant_name, _variant)| {
CompletionItem::new(
CompletionKind::Reference,
ctx.leaf_range(),
ctx.source_range(),
variant_name.to_string(),
)
.kind(CompletionItemKind::EnumVariant)