Support for Multiple Languages in a Single Notebook Document #1488
-
Hello Langium Community, I'm working on a project that involves using Langium to define a language for metadata and validation rules within a notebook environment. We've encountered a challenge that I believe could benefit from your insights and potential solutions. Problem Description: In our setup, we have a notebook document that can contain cells with different languages (e.g., metadata, validations, permissions). Each cell within the notebook is expected to have its own service instance based on the language specified in the cell. However, we've found that the Current Implementation: Our current approach involves creating a new instance of Proposed Solution: We've considered modifying the Questions:
Additional Context:
We're looking forward to any suggestions, insights, or potential solutions that could help us overcome this limitation. Thank you for your time and support. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Hey @samir-abis-everest,
As far as I know, we don't manipulate the URI that comes from vscode in any way. Therefore, it should contain the full cell URI (which is effectively just
I'm a bit confused about this: Do you have multiple languages - that are registered as separate languages - in VSCode that use the same language server? If so, how? I'm not aware of such a functionality in the implementation of |
Beta Was this translation helpful? Give feedback.
The
vscode-languageserver
package exports aNotebookDocuments
class, that should be used similar to the currently usedTextDocuments
class. One would need to use that in theLanguageServer
service implementation and also adapt theLangiumDocumentsFactory
to handle that better.It probably makes sense to implement support for that natively in Langium. I've created #1496 to track this.