Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static basicCompletionItemToSuggestion(item) {
const completion = {
text: item.insertText || item.label,
displayText: item.label,
filterText: item.filterText || item.label,
type: AutocompleteAdapter.completionKindToSuggestionType(item.kind),
leftLabel: item.detail,
description: item.documentation,
descriptionMarkdown: item.documentation,
};
if (item._returnDetail) {
completion.leftLabel = item._returnDetail;
}
if (item._parametersDetail) {
completion.rightLabel = item._parametersDetail;
}
return completion;
}
}