Why is the URI required for the document from a string? #1395
-
I would assume that a URI would not be necessary to specify when extracting a Langium document from a string in code instead of extracting from an external file. However, this is not the case with the functions provided for extracting a document from a string in code: Is there any reason why the URI is required in this case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @Lemour-sudo, in essence, the |
Beta Was this translation helpful? Give feedback.
Hey @Lemour-sudo,
in essence, the
uri
is the unique identifier of a document. Since Langium is mostly designed to support language servers, and all documents inside of a language server require a uri identifier (otherwise they're not addressable), we decided to make it a mandatory property. From a maintenance perspective, having it optional would make every bit of code dealing with those documents very verbose.