Skip to content
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

Add some examples how to configure QuasiQuotation syntax highlighting? #185

Open
vaclavsvejcar opened this issue Apr 11, 2021 · 2 comments

Comments

@vaclavsvejcar
Copy link

First of all, I'm sorry if this is too much unrelated to language-haskell itself, but I was wondering if you could provide some examples (or at least links to some external documentation) how exactly can I configure the newly added logic that allows syntax highlighting for quasiquotes? Why I'm asking for this - I'm really happy with this VSCode extension, but I have zero experience how it works under the hood. I can imagine that most of people would use this highlighting stuff to some common use-cases, such as to highlight quasiquotations used to build regular expressions or string interpolators, such as:

let regex = [re|^\h*-}|\w+\h*-}|^--|]
let interpolated = [i|Hello, #{userName user}|]

I have no idea how much work is to configure the syntax highlighting for this, but maybe it would be worth it to more promote this feature in documentation with few examples?

@vaclavsvejcar
Copy link
Author

@JustusAdam could you please give some hints how to do this? After that I'm happy to make PR with adding the documentation somewhere, if you're interested (e.g. README.md).

@JustusAdam
Copy link
Owner

Hey Thanks for the feedback.

Unfortunately this is not a feature I implemented or dug into a lot. But the way I see it there is a meta.embedded.block.{quasi-quoter} scope that gets assigned to the quoter. I think you then need to define how that is highlighted with an embedding like this one here we use for markdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants