Skip to content

RubyLSP problem #1697

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

Closed
1 task
JonathanSilvestre opened this issue Dec 2, 2023 · 13 comments
Closed
1 task

RubyLSP problem #1697

JonathanSilvestre opened this issue Dec 2, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@JonathanSilvestre
Copy link

JonathanSilvestre commented Dec 2, 2023

Operating System

Windows 11

Ruby version

ruby 3.2.2

Project has a bundle

  • Has bundle

Ruby version manager being used

no manager

Description

image
yesterday the extension show me this error and i don't make any change in my computer or visual

@JonathanSilvestre JonathanSilvestre added the bug Something isn't working label Dec 2, 2023
@SaidRasinlic
Copy link

SaidRasinlic commented Dec 3, 2023

Same problem (Windows 10)! I was about to open this bug too, because nothing seems to work even with the reinstallation of the extension or manually creating my "ruby_lsp_projectName" file in %temp% folder (which shouldn't be done).

Out of nowhere, this happened. Everything seemed to work perfectly until today, when I turned on my PC and got this error, just like you did 🤔

The Ruby LSP output, as seen in the screenshot, indicates that it is only in an attempting state to be activated; there is no detailed message regarding it.

Ruby-LSP-(tmp-error)

@akirataguchi115
Copy link

Same here.

@vinistock
Copy link
Member

This is most definitely because of Shopify/vscode-ruby-lsp#918, but I don't understand why it's happening. That PR started using a temporary file to write the Ruby environment activation because some shell configurations take over STDERR and caused issues.

For some reason, writing the temporary file is failing. Either that or it is somehow being deleted before we read it. Trying to figure out why that's happening...

@JonathanSilvestre
Copy link
Author

I found a solution for this error and it is to update the version of the extension to the preview version and with that the error disappears, I don't know why but it works.

@wsethbrown
Copy link

Also having this issue. I tried updating to the Pre-Release Version and reloading but it still persists. I stumbled across this thread because I wonder if this is causing Go to Definition from working.

Screenshot 2023-12-04 at 10 20 47 AM

@JonathanSilvestre
Copy link
Author

That's very strange on my computer it works fine but i don't know why in yours doesn't works

@vinistock
Copy link
Member

I made a release reverting that change while we understand the problem better.

@andyw8
Copy link
Contributor

andyw8 commented Dec 4, 2023

I'm not too familiar with Windows, but a post here says the Disk Cleanup tool may delete those files. Could something have triggered that to run?

@akirataguchi115
Copy link

I just installed Ruby fresh on Windows 11 yesterday and didn't manage to use Disk Cleanup in that short period before that error popped for me.

@akirataguchi115
Copy link

Version v0.4.22 has fixed it for me at least for now. Does updating work for you @Gatoloko44 ?

@SaidRasinlic
Copy link

SaidRasinlic commented Dec 4, 2023

This is most definitely because of Shopify/vscode-ruby-lsp#918, but I don't understand why it's happening. That PR started using a temporary file to write the Ruby environment activation because some shell configurations take over STDERR and caused issues.

For some reason, writing the temporary file is failing. Either that or it is somehow being deleted before we read it. Trying to figure out why that's happening...

I opened tmp files and observed what's happening when I open VSCode, and it seems like it creates folders (related to the Ruby LSP extension) and then they immediately get deleted automatically (I had to record to catch that).

Here is a video (reduced video quality so it can fit <10MB) of what's happening when I open VSCode, and as you can see on 0:05, it creates 3 folders, and they immediately get deleted, and then that Ruby LSP error pops out (Failed to activate...)

ruby-lsp-error-compressed.mp4

ruby-lsp-tmp

@JonathanSilvestre
Copy link
Author

Version v0.4.22 has fixed it for me at least for now. Does updating work for you @Gatoloko44 ?

Yes it worked for me

@vinistock
Copy link
Member

@SaidRasinlic thank you for sharing that video, it helps better understand the problem. It looks like writing to the temporary file succeeds, but then it gets immediately removed (possibly by antivirus software?).

In that case, we won't be able to fix problems like #1712 (where the STDERR pipe is hijacked by a shell plugin) until Shopify/vscode-ruby-lsp#923 is finished and shipped (which decouples the extension from the shell).

I'll close this issue for now since we reverted the PR that caused trouble.

@st0012 st0012 transferred this issue from Shopify/vscode-ruby-lsp Mar 18, 2024
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

7 participants