-
Notifications
You must be signed in to change notification settings - Fork 108
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
Portable regex-based syntax highlighting #176
Comments
The closest I’ve come across is Iro but that doesn’t support Vim or Emacs. |
Perhaps one could daisy-chain that with something like tm2deftheme or coloration? |
As already suggested by @paulyoung and @danieldjohnson, we can use Iro (for VSCode, Eclipse, Intellij, Sublime Code, Atom and a few others), daisy-chain that with Edit: tm2deftheme is apparently for themes and not syntaxes, I think. |
That looks great! One minor point would be that we only use upper-case letters for types as a convention, not because it's a requirement (unlike in Haskell), so matching on that can sometimes incorrectly color regular functions such as |
@apaszke Gotcha, I'll publish this so we have something to start with and then have a follow-up PR with more context sensitive highlighting.
|
So, what's the state of this issue? It looks pretty useful @sureyeaah @apaszke |
@joaogui1 Forgot about this, will send a PR this week. |
@sureyeaah adding stuff to this repo sounds reasonable for now. I don't know anything about the licensing issues of vscode marketplace and I suspect that it depends on what you want to put up there. Self-contained scripts that define syntax highlighters that are entirely authored by you should be ok. Distributing any Haskell components would be more tricky, because we would have to bundle all the licenses of our dependencies. |
Pinging @sureyeaah |
@joaogui1 sorry, I'm working on this right now. |
Created portable syntax highlighting using Iro along with a vscode plugin. Fixes google-research#176
For what it's worth, I wrote a simple vim plugin: https://github.com/sharadmv/dex-vim. Hope it's helpful! |
@sharadmv Thanks! I'll merge this PR and then if it's alright, I'll make some improvements to these plugins and your vim one as well. |
Yes please! It's my first vim plugin so I don't entirely know what I'm doing. |
Is this still active. How can I get a hold of it for use in VSCode? |
Need someone to take ownership of this PR :( |
For the record, PR #503 was an attempt here; reading the conversation there, it was close, but didn't quite make it over the line. Could be picked up to complete this issue, or one could start fresh. |
Would a tree-sitter grammar make sense? This would be a two birds/one stone situation for me, since I'd also like to get a better handle on how Tree-sitter works. |
Yeah, tree-sitter seems really promising! That would be great. |
Oops, I just saw this! For what it’s worth, as I couldn’t find a syntax highlighting extension for Dex in the Marketplace, I wrote a little VS Code extension based the regexes of the Emacs Lisp file: |
any luck with a tree-sitter-dex implementation? I would be interested in working on that but not sure how it aligns with some of the current project goals (#1304) - may not be a priority for the project if |
A bit of syntax highlighting goes a long way towards making things more readable. Right now we have a little emacs mode and an independent syntax highlighter for the HTML renderings using parser combinators. Does anyone know of a portable solution that lets us define a bunch of regexes and generate modes for vim, emacs, sublime etc?
The text was updated successfully, but these errors were encountered: