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

"Invalid yield" diagnostic in erb #2442

Closed
mbriggs opened this issue Aug 14, 2024 · 1 comment · Fixed by #2444
Closed

"Invalid yield" diagnostic in erb #2442

mbriggs opened this issue Aug 14, 2024 · 1 comment · Fixed by #2444
Assignees
Labels
bug Something isn't working

Comments

@mbriggs
Copy link

mbriggs commented Aug 14, 2024

Description

On Neovim v0.10.1 going through lspconfig/mason with ruby-lsp v0.17.13

Reproduction steps

given

<!DOCTYPE>
<html>
  <head>
    <%= yield :head %>
  </head>
  <body>
    <%= yield %>
  </body>
</html>

I am seeing "Invalid yield" on both variants

image

Love the work you are doing, and appreciate how well things work at this point in erb :)

@mbriggs mbriggs added the bug Something isn't working label Aug 14, 2024
Earlopain added a commit to Earlopain/ruby-lsp that referenced this issue Aug 14, 2024
Some things that are valid in erb would not be valid in a standalone ruby file.
This particularly impacts `yield`.
Instead treat the provided code as being evaled

Closes Shopify#2442
Earlopain added a commit to Earlopain/ruby-lsp that referenced this issue Aug 14, 2024
Some things that are valid in erb would not be valid in a standalone ruby file.
This particularly impacts `yield`.
Instead treat the provided code as being evaled

Closes Shopify#2442
@st0012 st0012 closed this as completed in e18d456 Aug 14, 2024
@Earlopain
Copy link
Contributor

Should be fixed in the next release, thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants