From 8657bc09bfb7235a2d019b6cf7548ff937b33477 Mon Sep 17 00:00:00 2001 From: Jordan Hall Date: Wed, 3 Apr 2024 07:52:59 +0100 Subject: [PATCH] docs(services): provide working example of provideCompletionItems (#16) --- src/content/docs/reference/services.mdx | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/content/docs/reference/services.mdx b/src/content/docs/reference/services.mdx index bf0e1aa..939a635 100644 --- a/src/content/docs/reference/services.mdx +++ b/src/content/docs/reference/services.mdx @@ -81,16 +81,21 @@ export const service = { create(context): ServicePluginInstance { return { provideCompletionItems(document, position, token) { - return [ - { - label: 'Hello', - kind: CompletionItemKind.Text, - }, - { - label: 'World', - kind: CompletionItemKind.Text, - }, - ]; + return { + isIncomplete: true, + items: [ + { + label: 'Hello', + kind: CompletionItemKind.Text, + isIncomplete: false + }, + { + label: 'World', + kind: CompletionItemKind.Text, + isIncomplete: false + }, + ] + } }, }; },