-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export grammar-related generators from CLI #1434
Conversation
@Lotes |
@dhuebner Thanks for the argument. That is a very valid point. Then I will only export the Textmate generator. But even there I am unsure: Shall I export it under "/textmate" or better under something more general like "/syntax-highlighting"...? Maybe start with something specific and deprecate when the time has come and it becomes more general? |
I agree with @dhuebner here. Exporting just what we need makes sense for now. And as for the name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the textmate-generator.js
file imports from ../util.js
, it also attempts to import node libraries such as node:path
and node:url
. We should split the node related utilities from the Langium related utilities, as the node imports make the ./textmate
import difficult to bundle in a browser environment. It would require a lot of shims/polyfills in order to successfully bundle/run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay from my end. Documentation is just a note, we'll handle that later of course 🙂 .
13c254c
to
4482eb5
Compare
I need to wait for #1437 since I want to increment the Langium CLI version and trigger Langium generator for the examples. |
76b4e69
to
2f791b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Just two minor suggestions, see below.
Co-authored-by: Mark Sujew <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, looks good to me 👍
For the Langium playground I need to import the Textmate generator.
Therefore I am exporting a couple of generators from the CLI.
My current alternative is to copy the code from this repo, which is actually not that nice.
Speak up if you want a different export strategy. Currently I am exporting each generator in its own export alias.
This PR adds a new ESM export
/textmate
to thelangium-cli
package. It contains the highlighting generator for Textmate syntax highlighters (Monaco editor).