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

Requires X11 display on Linux #45

Open
samdphillips opened this issue Apr 5, 2021 · 6 comments
Open

Requires X11 display on Linux #45

samdphillips opened this issue Apr 5, 2021 · 6 comments

Comments

@samdphillips
Copy link

When I ssh into my workstation and attempt to use nvim with racket-langserver I get the following error:

Unable to init server: Could not connect: Connection refused
Gtk initialization failed for display ":0"
  context...:
   body of "/usr/local/stow/racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt"
   body of "/usr/local/stow/racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt"
@samdphillips
Copy link
Author

It does work if xvfb is installed so running xvfb-run racket --lib racket-langserver is a workaround for now.

jackfirth referenced this issue in 9999years/racket-package-resyntax-action Apr 8, 2021
come on @jackfirth why must you torture me in this way
@Runi-c
Copy link
Contributor

Runi-c commented Apr 12, 2021

Looks like this was brought up before in #18. The fundamental cause is that the racket server relies (heavily) on the editor class text% provided by racket/gui/base, and even just requiring this package causes it to try and initialize a display, even if one won't actually be used. I'm doubtful that there's anything we can do here without basically re-implementing all of the navigation and paragraph features from text%.

@Lazerbeak12345
Copy link

I'm not sure if this is a good idea at all, but I've been brewing on it and wanted to share some thoughts.

We could make drracket depend on this library for the code analytics features and make this library not depend on drracket anymore. (in essence swap the dependency direction to ensure we don't need x11 or libgdk for what is supposed to be a headless service)

But tbh that's a drastic change, and now probably isn't the time for such a thing.

@Lazerbeak12345
Copy link

color-textoid<%> may solve this

@hunkyjimpjorps
Copy link

I'm trying to use the workaround with xvfb-run in a Github Codespace, but the server immediately crashes five times and then Magic Racket gives up.

@GregShiner
Copy link

We could make drracket depend on this library for the code analytics features and make this library not depend on drracket anymore. (in essence swap the dependency direction to ensure we don't need x11 or libgdk for what is supposed to be a headless service)

I second this. This is how LSP is supposed to be done. Unfortunately, DrR doesn't actually use LSP AFAIK since it predates the release of LSP standard. It seems like what they are doing is decoupling the language services from DrR and building the LSP implementation on top of that.

If the racket core team were to make this change though, it would have some pretty awesome benefits by fully adopting the LSP standard. But, it is quite a big ask.

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

No branches or pull requests

5 participants