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

Allow customization of number of servers to start #249

Open
phst opened this issue Apr 12, 2019 · 3 comments
Open

Allow customization of number of servers to start #249

phst opened this issue Apr 12, 2019 · 3 comments

Comments

@phst
Copy link
Contributor

phst commented Apr 12, 2019

Currently Eglot (typically) starts one server per project and mode. However, there are servers that can manage an arbitrary number of modes and projects. For such servers, starting many of them is wasteful and can be very expensive. Therefore it would be great to be able to customize the number of servers to start. For example, there could be a per-binary key extraction function that could return a pair (mode, project) for the current behavior or the local hostname for the one-server-per-machine case.

@nemethf
Copy link
Collaborator

nemethf commented Apr 12, 2019

I think using fewer servers when possible makes sense. However, I don't really like the idea of specifying the number of servers to start. One server could possibly serve 10 projects each having just one short file, but it may not have the resources to serve two projects containing 10000 files.

Can you list some servers that can manage many projects and some other servers that cannot?

(There's a workaround for this situation: start the server manually in networking mode and then instead of letting eglot start the server, start eglot with C-u M-x eglot RET host:port RET (e.g, localhost:2020), which will connect to the already running server.)

@joaotavora
Copy link
Owner

(There's a workaround for this situation: start the server manually in networking mode and then instead of letting eglot start the server, start eglot with C-u M-x eglot RET host:port RET (e.g, localhost:2020), which will connect to the already running server.)

+1

This would go great with the development of a "server multiplexer program", which is an LSP server proxy of sorts. It would do this for any server, even ones that can't be started in networking mode. Such a program (which doesn't have to be written in Emacs Lisp at all, indeed it would preferably ue some general purpose, generally available language like Python) could solve another problem: it could have Eglot talking to two servers simultaneously, by tricking Eglot into believing it is talking to a single server. This would cover the multi-language-file case elegantly, I think. At any rate it would be much harder to ram this into Eglot's models.

That server multiplexer could also be used for other clients, of course, not just Eglot.

Unfortunately, I don't have time at all to

@artemkovalyov
Copy link

Is there any life here? This would be a killer addition to Eglot.

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

4 participants