Support for multiple projects within a workspace #1340
-
I am working on incorporating support for multiple projects within a single workspace, ensuring that the scopes of one project remain isolated from others. Currently, a project is identified by the location of a specific project file ( In the provided figure, you can observe that To achieve this, I am seeking guidance on the most effective approach for implementation. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @we-wake-act21, this should be relatively straightforward, assuming you have a good way of identifying which file belongs to a given workspace. You will need to override the global scope computation: langium/packages/langium/src/references/scope-provider.ts Lines 100 to 102 in 728b579 in a custom scope provider and return a dedicated, filtered scope based on the current project. You can find the currently scoped document via the Note that the current scope provider + index manager is heavily optimized towards a single global scope. You might run into performance issues, if you don't take care of stuff like caching etc. |
Beta Was this translation helpful? Give feedback.
Hey @we-wake-act21,
this should be relatively straightforward, assuming you have a good way of identifying which file belongs to a given workspace. You will need to override the global scope computation:
langium/packages/langium/src/references/scope-provider.ts
Lines 100 to 102 in 728b579
in a custom scope provider and return a dedicated, filtered scope based on the current project. You can find the currently scoped document via the
context
argument.Note that the c…