-
Notifications
You must be signed in to change notification settings - Fork 48
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
QuasiQuotes #23
Comments
It would be nice if language-haskell would somehow allow for extended syntax highlighting on QuasiQuote expressions. |
Wondering if there are any plans for this issue? Any chance to have quasiquotes somehow visually distinguished? |
My intuition is that it is possible, but I don't have the time to work on it. If you want to give it a shot go ahead. AFAIK there are standard quasi quoters for declarations and expressions. A multi line matcher could be used for the quote brackets and then an include for the expression or declaration rules would add the desired highlighting. |
Right now QuasiQuotes are incorrectly linted if there are keywords in it. |
Hi, I'm dealing with the same problem. Why is this marked as enhancement and not as bug? |
I've made a simple change so that the entire quasi-quotation is only given the The "enhancement" part of the bug pertained to the ability to highlight the inside of the quasi-quote depending on the quasi-quoter, e.g. highlight a JSON quasi-quotation using JSON rules, or highlight the different types of Haskell quasi-quotations (type/expression/etc) using the appropriate rules. |
@sheaf, that makes sense. And thank you for implementing the quick fix 😃, the highlighting inside of quasiquotes was killing me. |
I also implemented simple Haskell highlighting for the expression, pattern, declaration and type quasi-quoters. Anything more than that starts getting a bit tricky unfortunately. |
Should 3.1.0 have these changes? I just updated but I don't see any of the new scopes :S. What could I be doing wrong? |
Yeah, I was exactly doing that and I didn't see the scope. There's must be something on my end (maybe conflicting with another extension?). I'll try with a clean vscode setup when I have time and see... |
The other thing you can try is to manually revert to an older extension ( |
Ah that's my fault. Apparently I forgot to rebuild the JSON before publishing. I really need to make that automatic. |
Yup, working for me in 3.2.0 now. On the bright side I learned a lot about scopes, textmate and stuffs along the way 😁 |
Run while you still can 😝 😆 |
Would it be possible to mark the quasi quote content with the scope For example, the content of [hsx|
<div>
...
</div>
|] would be marked as If I got it correctly, it would then be possible to provide separate extensions for any quasiquote syntax. |
@jbpotonnier Thanks for the suggestion, which I've implemented in 4c9905e. So we have: [hsx| ... |]
^^^ meta.embedded.block.hsx
[Qualifier.hsx| ... |]
^^^ meta.embedded.block.hsx Let me know if that works for you. |
@poscat0x04 Fixed the issue with empty quasi-quotations in 150c9c5, thanks for the bug report. |
They can mean just about anything so their contents should be treated either as plain text or a string literal.
There is a list of reserved names for quotes that should remain as Haskell code.
The text was updated successfully, but these errors were encountered: