Skip to content

Correct way to get returnType to show in completionItem List #1877

Answered by msujew
ejfasting asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ejfasting,

you can override the DefaultCompletionProvider#createReferenceCompletionItem method to adjust what is displayed as the detail of each completion item:

protected createReferenceCompletionItem(nodeDescription: AstNodeDescription): CompletionValueItem {
const kind = this.nodeKindProvider.getCompletionItemKind(nodeDescription);
const documentation = this.getReferenceDocumentation(nodeDescription);
return {
nodeDescription,
kind,
documentation,
detail: nodeDescription.type,
sortText: '0'
};
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ejfasting
Comment options

Answer selected by ejfasting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants