Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

language server cannot run without a running X11 server #19

Open
ghost opened this issue Aug 16, 2020 · 2 comments
Open

language server cannot run without a running X11 server #19

ghost opened this issue Aug 16, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 16, 2020

On linux, due to the (recursive) dependencies on gui-lib, racket-langserver cannot run without a running X11 server. I believe the responsible dependencies are, besides gui-lib itself, drracket-tools-lib, which can be easily refactored into a headless component for racket-langserver, based on my experimentation... and racket-doc, which cannot. Since I've never used racket I'm not entirely sure what that racket-doc is doing; maybe it's not so hard to fix that issue as well.

Anyways, here's what happens if you try without X installed:

Welcome to Racket v7.8.
> (require racket-langserver)
; ffi-lib: couldn't open "libgdk-x11-2.0.so.0" (libgdk-x11-2.0.so.0: cannot
;   open shared object file: No such file or directory) [,bt for context]

With X installed but not running:

Welcome to Racket v7.8.
> (require racket-langserver)
Unable to init server: Could not connect: Connection refused
; Gtk initialization failed for display ":0" [,bt for context]

For completeness, with GTK installed and a non-X backend running there's also an error loading libX11.

Since this info was surprising to some people: Yes, there's a point to running a language server on a headless server: not only for TUI text editors, but even for GUI ones like VS Code Remote. And for what it's worth, I've not run into any other language servers which require X.

@DKXXXL
Copy link

DKXXXL commented Sep 7, 2020

Any help will be welcomed. As the OP said, I am currently using Magic Racket plugin on VSCode which depends on this LSP.
Since I am working on WSL2, my experience for Linux is quite limited, (I don't even know how to start X server on WSL2 to let this LSP run).

@Danl2620
Copy link

Danl2620 commented Nov 6, 2020

The package you are referring to is hosted at https://github.com/jeapostrophe/racket-langserver. This is racket-language-server, a different implementation of the LSP.

(The Magic Racket VS Code extension uses the other LSP package.)

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

No branches or pull requests

2 participants