-
|
We are just switching to langium 2.0.0. It seems there are many great things you did (e.g., better scoping). Thank you for that! We have a langium language project, where we have models using "imports" (which means we reference across model files). Imports are only validated (to detect import errors) and not used for scoping (as suggested in #458). Normally we load whole folders/workspaces (like vscode). This works as before: Also when using the IDE (vscode) everything works (no error). Our problem: However, we also have a special loading function which analyzes the loaded models (before link resolution) and collects relevant files by analyzing the imports): After migration to langium 2.0.0 we get a I checked |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Yes, that's perfectly fine if there's no real workspace available.
No, that shouldn't be an issue. By default the document builder just rebuilds the documents that you give it + the documents which either contain linking errors or haven't finished the full build yet. We did quite a large refactoring in 2.0.0 of the document builder with #1094. There might be a regression that we introduced accidentally, though I'm not sure how. Without looking deeper/debugging this issue, I can't really tell what the issue is. Can you provide a reproducible example for us? |
Beta Was this translation helpful? Give feedback.
Thanks again for your excellent support!
Overriding the document builder and call the onUpdate emitter was not solving my problem.(see comments below: #1190 fixes the problem)I added a method
clearCachein my ScopeProvider:Then calling
clearCachebeforeawait services.shared.workspace.DocumentBuilder.build(docs, { validation: true });solves my problem.Do you understand what happend?