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 ERB support in HEREDOC #2903

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add ERB support in HEREDOC #2903

wants to merge 2 commits into from

Conversation

vtno
Copy link

@vtno vtno commented Nov 22, 2024

Motivation

Closes #2863

Implementation

Added the ERB config to the definition file and update the test

Automated Tests

The test case is updated to check for the ERB format in heredoc.

Manual Tests

@vtno vtno requested a review from a team as a code owner November 22, 2024 17:03
@vtno
Copy link
Author

vtno commented Nov 22, 2024

I have signed the CLA!

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems to be missing still. I tested this branch with some ERB heredocs and it looks like the ERB grammar is only being partially applied for some reason. I'm not sure why yet.

@@ -1653,6 +1653,44 @@
}
]
},
{
"begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)erb)\\b\\1))",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all of the other cases, we only support upper case delimiters.

Suggested change
"begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)erb)\\b\\1))",
"begin": "(?=(?><<[-~]([\"'`]?)((?:[_\\w]+_|)ERB)\\b\\1))",

"name": "meta.embedded.block.erb",
"patterns": [
{
"begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)erb)\\b\\1)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all of the other cases, we only support upper case delimiters.

Suggested change
"begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)erb)\\b\\1)",
"begin": "(?><<[-~]([\"'`]?)((?:[_\\w]+_|)ERB)\\b\\1)",

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

Successfully merging this pull request may close these issues.

Syntax highlight for ERB in heredoc
2 participants