-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Language support for VSCode? #690
Comments
VSCode extention for Expr is in the works. 😉 But difficult comes with providing Env completions and embedding in other languages. For now it will be more like a separate highlighter for separate files. How do you use Expr? How do you think highlighter should work? |
For us, expressions will appear within a yaml block which is in turn within markdown frontmatter. Completions etc would be lovely, but the main things are highlighting (followed by diagnostics). For highlighting - if there's a TextMate language/grammar spec created for your VSCode extension, then that can also be embedded in other language extensions created by users adding For diagnostics - there's a few ways to skin this cat, but as long as we can run validation of an expression without choking on the absence of runtime variables then users can create their own diagnostics and a lightweight language server. Of the two, diagnostics is likely the easier to solve as a user of Would you be able to share/open source whatever code you have that enables highlighting of |
Sure. Will try to shape it into some sort of a package. But how you will embed one grammar into YAML? |
Perhaps I've misunderstood Expr Editor, but I thought it was a standalone tool. If that's the case, then I couldn't really make use of it in the context Expr is used. My end users will be editing my config syntax within their own IDEs, with Expr being one part of that wider syntax. It'd be a big ask to have them change their local dev flow and tooling in order to make best use of the expression syntax I've chosen. You can embed languages by matching the key and defining it as using a specific grammar. GitHub Actions do this with the GitHub Actions VSCode extension (also on their expressions). If you check that out, you'll notice that whilst it's YAML, the There's a few ways to support embedded languages though, this VSCode doc goes into more detail. |
Cool. Will definitely check this out. |
Thanks for the awesome project!
I'm considering using expr embedded within a product, however I'd want to ensure my end users get syntax highlighting within their editor (VSCode support as a minimum). Without this end users aren't going to have the best possible experience.
I can't really expect them to use the standalone
expr
editor given that by its nature this is embedded within other syntaxes and contexts (so users pulling out the expression to work on in another editor is too much friction).I can see on the docs site you've got
expr
blocks highlighted and you're using prism, but I couldn't track down how that was being implemented.Do you already have a TextMate grammar, language server or VSCode extension? If not, can something along these lines be added?
The text was updated successfully, but these errors were encountered: