-
Hello, I'm using langium as one of many embedded languages. It's beging used like this:
In my case what i hover is a cross reference. From testing it looks like the Is it supposed to be possible to 'only' pass a langiumDocument to a provider and have it parse the content directly? Or do you have to add a DocumentUpdateHandler for it to work properly? //Eivind |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @ejfasting, in order to provide hovers for targets of cross references, i.e.: const value = 42;
value // <-- hover here Langium needs to resolve those cross references to figure out what kind of information to provide on hover. Generally, the Ideally, you should be able to replicate the document handling that is happening inside of |
Beta Was this translation helpful? Give feedback.
Hey @ejfasting,
in order to provide hovers for targets of cross references, i.e.:
Langium needs to resolve those cross references to figure out what kind of information to provide on hover. Generally, the
DocumentBuilder
should be invoked to build documents. Langium is simply not designed to provide LSP results without first going through the document lifecycle.Ideally, you should be able to replicate the document handling that is happening inside of
addDocumentUpdateHandler
. I've recommended this also already in #1494 (comment), as these services are meant to cache relevant data across rebuilds so that you don't run into performance issues in yo…