Open balupton opened 1 year ago
I agree it would be nice, I do a lot of heredocs like this. I've also embedded nested languages like this in other syntaxes. It's not the easiest thing to do right, but I'll see what I can do, it might take me a bit to get around to implementing it. It must be done for every language manually.
Also it's always nice to meet another Deno developer :wave:
Good to hear, take your time.
PS. If you can, you should activate GitHub Sponsors, I try to sponsor everything I use at $1/month (under the belief that if everyone does so too, then paying it forward would also pay the bills).
While it isn't much, I've posted a $20USD bounty for this: https://app.bountysource.com/issues/123759829-syntax-highlighting-of-heredoc-statements
What editor are you using ?
vscode
Please do not use bountysource. Many devs have had trouble getting paid there. You can check out this lemmy community as an alternative https://lemmy.ml/c/bugbounties
For statements from devs who have been unable to cash out from bountysource see: https://github.com/bountysource/core/issues
@makeasnek thanks for the heads up, I've submitted disputes to paypal — any thoughts on https://www.gitcoin.co and https://fundrequest.io/requests?phase=open - never heard of lemmy before.
Lemmy is like reddit but it's OSS and federated. Gitcoin no longer does bounties, only "hackathons" unfortunately. I haven't used fundrequest but looks interesting.
Some progress; the example now has a string.quoted.heredoc.no-indent.RUBY
tag instead of just string.quoted.heredoc.no-indent
. And this works for any language/delimiter.
So, now, anyone can make a VS Code extension that targets, for example string.quoted.heredoc.no-indent.RUBY
and have that section be highlighted with the grammar of their choice (ex: the ruby grammar).
The code with a problem is:
https://github.com/discourse/discourse_docker/blob/313f86feffe996349ec83877ccc57f6e12849446/launcher#L348-L368
It looks like:
It should look like:
https://github.com/discourse/discourse_docker/blob/313f86feffe996349ec83877ccc57f6e12849446/launcher#L348-L368
Suggestion
Instead of simply using
EOF
one should be able to use a language identifier, such asRUBY
,JAVASCRIPT
,TYPESCRIPT
, etc, to highlighting the contents inside the heredoc as the language.For myself that will provide a much better experience for pieces of code like: https://github.com/bevry/dorothy/blob/b467c8e2ecedadb5cbc41c1c778b420a91c60454/commands/brew-installed#L119-L162
Which is typescript code being sent to deno