ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Syntax highlight for ERB in heredoc

Open vtno opened this issue 2 years ago • 6 comments

I have checked that this feature is not already implemented

  • [x] This feature does not exist

Use case

I'm writing a lot of my ViewComponent with inline erb as heredoc and it would be great if the syntax highlight works for it as well.

Description

Based on the current grammar, using ERB in heredoc won't get syntax highlighted like the other supported language in this file.

I tried with HTML and it worked only with the non Ruby part.

It's quite odd that there are support for JS, GRAPHQL, and other languages but not ERB.

Implementation

We only need to add a configuration for ERB to the grammar file.

vtno avatar Nov 17 '24 01:11 vtno

Thank you for the feature suggestion! We should definitely handle ERB heredocs too.

vinistock avatar Nov 18 '24 20:11 vinistock

@vinistock I can try to make a PR for this.

vtno avatar Nov 18 '24 20:11 vtno

Awesome! If you hit any blockers, don't hesitate to ping the team in this issue.

vinistock avatar Nov 18 '24 20:11 vinistock

I added a PR. I was using this HAML support PR as a guideline.

Please help review 🙏

vtno avatar Nov 22 '24 17:11 vtno

This issue is being marked as stale because there was no activity in the last 2 months

github-actions[bot] avatar Jan 22 '25 12:01 github-actions[bot]

This issue is being marked as stale because there was no activity in the last 2 months

github-actions[bot] avatar Mar 24 '25 12:03 github-actions[bot]