-
Hi guys, I'm working on improving the auto-completion experiences of my DSL, and would like to provide richer documentation in the popup window. Like how Prisma does it: ![]() I'm looking at the code of Just wanted to get some confirmation before trying things out more deeply. Thanks 🙏! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey @ymc9, the Anyway, the best solution for you right now would be to extend the langium/packages/langium/src/references/linker.ts Lines 203 to 210 in 728b579 |
Beta Was this translation helpful? Give feedback.
-
I basically did what @msujew proposed above in a concept requirements DSL I was working on. I extended the |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick response @msujew , as always! I'll go ahead with the approach then. @alamarche your sample looks tremendously helpful 🙏 ! |
Beta Was this translation helpful? Give feedback.
Hey @ymc9,
the
DocumentationProvider
is currently only used by theDefaultHoverProvider
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 thecreateReferenceCompletionItem
method. You can then set thedocumentation
field on the returnedCompletionValueItem
object. Note that you only have anAstNodeDescription
in scope of thecreateReferenceCompletionItem
method. You might need to resolve it first. See:langium/packages/langium/src/references/linker.ts
Lines 203 to 210 in 728b579