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

Highlight block correctly in ERB file #2929

Open
jbigler opened this issue Nov 28, 2024 · 5 comments · May be fixed by #3061
Open

Highlight block correctly in ERB file #2929

jbigler opened this issue Nov 28, 2024 · 5 comments · May be fixed by #3061
Labels
bug Something isn't working good-first-issue Good for newcomers help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale

Comments

@jbigler
Copy link

jbigler commented Nov 28, 2024

When highlighting the control block structure within an ERB file, if there is a block defining word used as a method argument keyword inside the block, it will match the end statement with that keyword instead of the control block.

With a class: argument in a method call (with or without parentheses):
Image

Without the class: keyword, it works fine:
Image

Calling class= as an HTML attribute is fine:
Image

Within a normal Ruby .rb file, this does not occur:
Image

@jbigler jbigler changed the title Highlight block in ERB file Highlight block correctly in ERB file Nov 28, 2024
@vinistock vinistock added bug Something isn't working help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale good-first-issue Good for newcomers labels Nov 29, 2024
@frandegrandis
Copy link

Hello!
Can i help with this one? I can try to fix it during the weekend!

@vinistock
Copy link
Member

Sure. Feel free to put up a PR.

@vicocamacho
Copy link

spent some time looking at this and wasn't able to reproduce the bug using main. This is how the snippet provided renders in VSCode for me:

Image

Are you still experiencing the issue? Can you provide a little bit more details if possible?

@jbigler
Copy link
Author

jbigler commented Jan 10, 2025

The issue isn't with rendering (I'm using Neovim BTW, but VS Code also has the feature), but with highlighting the corresponding block's opening or closing statement. Notice the position of the cursor and the words with the blue highlights in my images.

Here is the PR that introduced the feature and has a video showing it in action.

#2779

@vicocamacho
Copy link

The issue isn't with rendering (I'm using Neovim BTW, but VS Code also has the feature), but with highlighting the corresponding block's opening or closing statement. Notice the position of the cursor and the words with the blue highlights in my images.

Here is the PR that introduced the feature and has a video showing it in action.

#2779

I see, thanks for the additional context it is extremely helpful. I will take a look and try to fix in the next few days

@vicocamacho vicocamacho linked a pull request Jan 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue Good for newcomers help-wanted Extra attention is needed pinned This issue or pull request is pinned and won't be marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants