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

unexpected local variable or method diagnostic in erb when multiple ruby fragments on the same line #2448

Closed
mbriggs opened this issue Aug 15, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@mbriggs
Copy link

mbriggs commented Aug 15, 2024

Description

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

Reproduction steps

Given erb with multiple ruby fragments on the same line, the diagnostic "unexpected local variable or method" shows up when it should not. If you add a line break in the source, it goes away. If you remove the line break, it comes back.

The expectation should be that each fragment is distinct.

image Note that the first example has line breaks and no diagnostics
@mbriggs mbriggs added the bug Something isn't working label Aug 15, 2024
@st0012
Copy link
Member

st0012 commented Aug 15, 2024

Does applying the configs from #2432 (comment) solve the issue?

@mbriggs
Copy link
Author

mbriggs commented Aug 15, 2024

I would imagine it would, since it would stop ruby-lsp from working at all with erb, but thats not what im looking to do :)

@st0012
Copy link
Member

st0012 commented Aug 15, 2024

Yeah sorry, please ignore that.
I can't reproduce this issue in VS Code though. The diagnostics feature should also be disabled for erb files anyway. Can you check with folks in #2432 to see if they have similar issues?

@mbriggs
Copy link
Author

mbriggs commented Aug 15, 2024

I don't really know whats going on, but taking a guess, i'm thinking that this isn't diagnostics, this is parse errors that show through diagnostics ui in neovim, but don't on vsc. However the raw ruby is getting parsed out of the erb is probably missing an explicit ; or something at the end of each fragment

@vinistock
Copy link
Member

Please see my comments in #2432 (comment).

@vinistock
Copy link
Member

Closing this as there's no fix from the Ruby LSP side.

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

No branches or pull requests

3 participants