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

Automatic discovery of Language Servers #2051

Open
kryptan opened this issue Oct 26, 2024 · 3 comments
Open

Automatic discovery of Language Servers #2051

kryptan opened this issue Oct 26, 2024 · 3 comments
Milestone

Comments

@kryptan
Copy link

kryptan commented Oct 26, 2024

Currently each IDE needs to be configured for each Language Server implementation. It would be nice if there was a way for IDEs to automatically detect installed servers.

This is possible for Jupyter kernels, each Jupyter kernel installs its config in ~/.jupyter and VSCode can automatically detect all installed Jupyter kernels, no need for any additional configuration or extensions.

Similar setup should work for LSP. There can be some standard folder like ~/.lsp. Each installed Language Server would store its config there. This config will specify command to run the server and will contain a list of supported file patters (e.g. file extensions and special files like package.json or Cargo.toml to look for). If IDE detects that there is a Language Server suitable for the current file/directory it could ask user to run it.

@mickaelistria
Copy link

I find this idea interesting and it echoes a (5-years old already?) idea of a language server registry that would also include the provisioning steps. But I have some doubts about it:
Usually, there are small details that make that running the LS is more than just running a command: the client sometimes have to check for pre-requisites, pass some specific system properties, decide whether std or socket fits best, decide whether to store some extra logs, decide of a particular runtime to use, sometimes pass extra configuration settings upon startup... All that is hard to capture in such a list of installed LS as the final set of operation to properly run the LS is more dynamically computed.

@dbaeumer
Copy link
Member

From all my experiences I came to the same conclusion than @mickaelistria. Usually this work in a starter case but as soon as language servers need more configuration being able to customize things is a big help. What I definitely want to avoid is to maintain a configuration language to be able to express this.

@mfussenegger
Copy link

Going by the servers supported in https://github.com/neovim/nvim-lspconfig/ I've the impression that the vast majority is really only cmd, filetypes and a way to detect a project root/workspace directory or signal if the server supports "single-file mode" (no workspace folder).

The project root detection is because in editors like nvim you don't start by creating a workspace folder, but you edit files directly (nvim path/to/file) and based on that file path you need to determine what the workspace folder could be. Usually that's stuff like .git, pyproject.toml, Cargo.toml.

Clients could still provide configuration options on top.

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

No branches or pull requests

4 participants