Use markdown details for (expression) auto-completions

This commit is contained in:
Christopher Schleiden
2023-01-06 15:27:25 -08:00
parent 4f961a6247
commit 873db60522
+8 -1
View File
@@ -109,7 +109,10 @@ export async function complete(
const item: CompletionItem = {
label: value.label,
detail: value.description,
documentation: value.description && {
kind: "markdown",
value: value.description
},
tags: value.deprecated ? [CompletionItemTag.Deprecated] : undefined,
textEdit: replaceRange ? TextEdit.replace(replaceRange, newText) : TextEdit.insert(position, newText)
};
@@ -212,6 +215,10 @@ function mapExpressionCompletionItem(item: ExpressionCompletionItem, charAfterPo
}
return {
label: item.label,
documentation: item.description && {
kind: "markdown",
value: item.description
},
insertText: insertText,
kind: item.function ? CompletionItemKind.Function : CompletionItemKind.Variable
};