Skip to content

Commit 8657bc0

Browse files
authored
docs(services): provide working example of provideCompletionItems (#16)
1 parent 40318d4 commit 8657bc0

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/content/docs/reference/services.mdx

+15-10
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,21 @@ export const service = {
8181
create(context): ServicePluginInstance {
8282
return {
8383
provideCompletionItems(document, position, token) {
84-
return [
85-
{
86-
label: 'Hello',
87-
kind: CompletionItemKind.Text,
88-
},
89-
{
90-
label: 'World',
91-
kind: CompletionItemKind.Text,
92-
},
93-
];
84+
return {
85+
isIncomplete: true,
86+
items: [
87+
{
88+
label: 'Hello',
89+
kind: CompletionItemKind.Text,
90+
isIncomplete: false
91+
},
92+
{
93+
label: 'World',
94+
kind: CompletionItemKind.Text,
95+
isIncomplete: false
96+
},
97+
]
98+
}
9499
},
95100
};
96101
},

0 commit comments

Comments
 (0)