From 467b13485397885ddf6dc51ba4f8b0b8eff5d9df Mon Sep 17 00:00:00 2001 From: Makito Date: Sat, 21 Sep 2024 19:03:30 +0800 Subject: [PATCH] fix: missing client capabilities --- src/yaml.worker.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/yaml.worker.ts b/src/yaml.worker.ts index 3287630..5eda893 100644 --- a/src/yaml.worker.ts +++ b/src/yaml.worker.ts @@ -11,6 +11,7 @@ import { type FormattingOptions, type Hover, type LocationLink, + MarkupKind, type Position, type Range, type SelectionRange, @@ -134,7 +135,20 @@ initialize((ctx, { enableSchemaRequest, ...langua // @ts-expect-error Type definitions are wrong. This may be null. schemaRequestService: enableSchemaRequest ? schemaRequestService : null, telemetry, - workspaceContext + workspaceContext, + // Copied from https://github.com/microsoft/vscode-json-languageservice/blob/493010da9dc2cd1cc139d403d4709d97064b17e9/src/jsonLanguageTypes.ts#L325-L335 + // Usage: https://github.com/microsoft/monaco-editor/blob/f6dc0eb8fce67e57f6036f4769d92c1666cdf546/src/language/json/jsonWorker.ts#L38 + clientCapabilities: { + textDocument: { + completion: { + completionItem: { + documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText], + commitCharactersSupport: true + } + }, + moniker: {} + } + } }) const withDocument =