-
Notifications
You must be signed in to change notification settings - Fork 52
Add support for HAML syntax highlighting in Heredoc sections #824
Conversation
I am not sure if we should keep adding highlighting for other languages inside Heredocs, since VS Code already does proper syntax highlighting for heredocs, provided a separate extension is installed for syntax highlighting the target language. For example, compare the following two screenshots from VS Code: Since I had the GraphQL syntax highlighting extension installed in my system, VS Code was able to highlight embedded GraphQL query in a heredoc properly, provided the heredoc label is |
Doesn’t that only work because there’s an entry for heredoc graphql here? vscode-ruby-lsp/grammars/ruby.cson.json Lines 1679 to 1715 in 1847681
|
1847681
to
b3b6e83
Compare
@joevandyk let's move forward with this. Can you add a test for I think just adding HAML to the list is sufficient. |
a5522b4
to
c2533fb
Compare
@vinistock added test! Anyone know how I can point my local VS Code to use this version of the code, so I can see the HAML syntax highlighting work? Do I build the gem and install it? Or is there a better process? |
These changes are only in the extension, so you can follow the instructions here. Basically, you need to
|
Please let us know if it's working as you expected and then we can merge. |
This pull request is being marked as stale because there was no activity in the last 2 months |
(similar to how SQL, HTML, JS, etc work)
c2533fb
to
750310d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the team are off for the holidays, but we can hopefully ship this in early January.
One small suggestion: It would useful to add a small mention of this feature to the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
Motivation
We have support for C++, JS, SQL, HTML, etc syntax highlighting in Heredoc, would be good to have it for HAML as well. Main use case for me is embedding HAML templates inline in ViewComponents.
Implementation
Copy/Pasted the HTML section.
Automated Tests
None, the other Heredoc syntax highlighting don't seem to have any.
Manual Tests