Refresh document diagnostics #987
-
Is there a way to refresh the diagnostics of a document? I have document that references other documents and I'm loading these other documents after the first one is parsed. But then the diagnostics of the original one just takes the first document into consideration. When I make any edit in the original document then diagnostics is fine. I think that there is some sort of race condition happening. If I could refresh the diagnostics for the first document, then I could force it right after adding all other documents. One interesting thing is that Langium is not firing I'm being very abstract here, I will work on an example to of this later today isolating the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I imagine your outside of the language server usecase? Note that lifecycle handling is a bit more manual once you move away from the language server. The langium-cli has a functionality which only updates document validations once all referenced documents have been loaded by the CLI. Is this similar to what you're trying to accomplish? Anyway, you can always refresh them manually by just running the document through the |
Beta Was this translation helpful? Give feedback.
I imagine your outside of the language server usecase? Note that lifecycle handling is a bit more manual once you move away from the language server. The langium-cli has a functionality which only updates document validations once all referenced documents have been loaded by the CLI. Is this similar to what you're trying to accomplish?
Anyway, you can always refresh them manually by just running the document through the
DocumentValidator
.