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

Crystalline server crashes if VSCode started with shortcut #179

Open
valerahime opened this issue Nov 3, 2023 · 6 comments
Open

Crystalline server crashes if VSCode started with shortcut #179

valerahime opened this issue Nov 3, 2023 · 6 comments
Labels

Comments

@valerahime
Copy link

Describe the bug
I use Crystalline as my language server, as Scry is now depreciated. Similar to #14, Crystalline crashes in VSCode if started through a desktop shortcut, but works fine if started through the code CLI command.

To Reproduce
Steps to reproduce the behavior:

  1. Start VSCode through desktop shortcut.
  2. See error.

Expected behavior
Crystalline should work normally.

Piece of Code
n/a

Screenshots
Screenshot_20231103_104733

Desktop (please complete the following information):

  • OS: Arch Linux (also seen on Windows 11 and MacOS)
  • Crystal version: 1.10.1
  • This plugin version: 0.8.4

Additional context
I'm not sure if this is a bug in this extension, or Crystalline itself.

@valerahime valerahime added the bug label Nov 3, 2023
@nobodywasishere
Copy link
Member

Can you let me know if this is still happening with v0.9.0?

@valerahime
Copy link
Author

valerahime commented Feb 2, 2024

Unfortunately it's still broken for me (at least on WSL, haven't tried on Linux/macOS yet).

[Crystal] loading lsp /home/matt/Projects/bin/crystalline
[Error - 12:56:06 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 12:56:06 PM] Connection to server got closed. Server will restart.
true
[Error - 12:56:06 PM] Crystal Language client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 12:56:07 PM] Connection to server got closed. Server will restart.
true
[Error - 12:56:07 PM] Crystal Language client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 12:56:07 PM] Connection to server got closed. Server will restart.
true
[Error - 12:56:07 PM] Crystal Language client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Info  - 12:56:07 PM] Connection to server got closed. Server will restart.
true
[Error - 12:56:07 PM] Crystal Language client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] The Crystal Language server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 12:56:07 PM] Crystal Language client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 12:56:07 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 

@nobodywasishere
Copy link
Member

@elbywan Do you know what could be causing this issue? Could the extension be calling crystalline incorrectly / crystalline not handling all the ways vscode is calling it?

@elbywan
Copy link
Contributor

elbywan commented Feb 24, 2024

Hey @nobodywasishere 👋

Do you know what could be causing this issue? Could the extension be calling crystalline incorrectly / crystalline not handling all the ways vscode is calling it?

I have no idea, sorry 😕 . crystalline is a simple LSP server binary which reads from stdin and writes to stdout.

Maybe starting the IDE through a shortcut is missing some (crystal?) environment variables which are inherited when booting from the terminal?

If crystalline crashes then an error should show up there - under the Crystal entry:

Capture d’écran 2024-02-24 à 19 36 33

@valerahime
Copy link
Author

I had a thought to try loading Crystalline using VSCode's built-in terminal, and received this error:

$ crystalline
2024-05-01T14:17:00.234684Z  ERROR - lsp: Error executing process: 'crystal': No such file or directory
???
???
???
???
???
src/env/__libc_start_main.c:95:2 in 'libc_start_main_stage2'
Error executing process: 'crystal': No such file or directory (File::NotFoundError)
  from ???
  from ???
  from ???
  from ???
  from ???
  from src/env/__libc_start_main.c:95:2 in 'libc_start_main_stage2'

This was in the Crystal project directory. Maybe this is related? I should note this is through a WSL install, so that might be weird.

I do think there's some issue with launching VSCode through a shortcut. On Mac/Linux, if I launch VSCode from the command line, the extension works fine.

@BigBoyBarney
Copy link

Hi!

I had the exact same issue as @Timecrash, as I mentioned in a Crystalline issue earlier today, except native linux with flatpak.

The issue seems to stem from the way both flatpak and WSL handle access to files. Using a native (non-flatpak) version of VSCodium works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants