Skip to content

Providing documentation in the auto-completion popup #1339

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

You must be logged in to vote

Hey @ymc9,

the DocumentationProvider is currently only used by the DefaultHoverProvider as part of the default Langium behavior. It might make sense to adjust the default completion provider to make use of that as well.

Anyway, the best solution for you right now would be to extend the DefaultCompletionProvider and override the createReferenceCompletionItem method. You can then set the documentation field on the returned CompletionValueItem object. Note that you only have an AstNodeDescription in scope of the createReferenceCompletionItem method. You might need to resolve it first. See:

if (nodeDescr…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ymc9
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants