Eugleo / magic-racket

The best coding experience for Racket in VS Code
https://marketplace.visualstudio.com/items?itemName=evzen-wybitul.magic-racket
GNU General Public License v3.0
204 stars 26 forks source link

Unable to init server on WSL #29

Closed jdan closed 2 years ago

jdan commented 3 years ago

Environment

Error message

Unable to init server: Could not connect: Connection refused
Gtk initialization failed for display ":0"
  context...:
   "/usr/share/racket/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   for-loop
   [repeats 1 more time]
   run-module-instance!125
   do-dynamic-require5
   "/usr/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt": [running body]
   temp37_0
   for-loop
   run-module-instance!125
   for-loop
   ...

Additional context

I am running this in Windows Subsystem Linux 2

Unsure why the langserver needs gtk, maybe that's just racket startup stuff? I'm able to run racket from my terminal without issue

jdan@DAPHNE:~$ racket
Welcome to Racket v7.2.
> (+  3 4)
7
>
Eugleo commented 3 years ago

Hey, next week I'm getting a Windows machine to test Magic Racket on WSL. So, hold on a little longer! In the meantime, check over at racket-langserver if this isn't a well-known problem.

1gmar commented 3 years ago

Hey @jdan, I'm experiencing a similar issue when trying to init server inside a devcontainer.

Have you managed to work around this issue?

Any insight would be highly appreciated.

jdan commented 3 years ago

Nope no dice yet but haven't tried anything fancy :)

stereobooster commented 3 years ago

related https://github.com/Eugleo/magic-racket/issues/31, https://github.com/jeapostrophe/racket-langserver/issues/18

xvbf is a potential solution here

Runi-c commented 3 years ago

This issue is now tracked at https://github.com/jeapostrophe/racket-langserver/issues/45

lopezca commented 3 years ago

Hello!

Great plugin, thank you!

I also have this issue when trying to run it when there is no display available; xvfb does work, but the server has to be started beforehand.

would it be possible to add a configuration option to change the command to launch the server? that way, it can be modified to make it work with xvfb and use it as usual.

cheers!

HugoBarreto commented 3 years ago

Could someone provide the exact steps that you're using to run racket-langserver in WSL?

I'm using VS Code and couldn't figure how to use xvfb in this context.

SFurnace commented 3 years ago

@HugoBarreto @jdan I found a workaround, please see this https://github.com/Eugleo/magic-racket/issues/51

Eugleo commented 2 years ago

Closing, as there is currently a workaround and the issue itself cannot be fixed on the side of Magic Racket. I will link the workaround from the readme.

tim-harding commented 2 years ago
{
    "magicRacket.languageServer.command": "xvfb-run",
    "magicRacket.languageServer.arguments": [
        "--auto-servernum",
        "racket",
        "--lib",
        "racket-langserver"
    ],
}

This is the configuration that works for me. I had to add --auto-servernum to make the server start up consistently.

coyorkdow commented 2 years ago

Same problem on vscode ssh to a Debian instance and magic-racket extension crashed. Using xvbf works fine to me.

{
    "magicRacket.languageServer.command": "xvfb-run",
    "magicRacket.languageServer.arguments": [
        "--auto-servernum",
        "racket",
        "--lib",
        "racket-langserver"
    ],
}

This is the configuration that works for me. I had to add --auto-servernum to make the server start up consistently.

jaybonthius commented 1 month ago

@tim-harding's solution also worked for me on Ubuntu, after installing xvfb.