-
-
Notifications
You must be signed in to change notification settings - Fork 890
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
Feature: automatic server installation #506
Comments
Some comments form my experience. I tried this package with |
@seagle0128 What issues did you run into with sudo on linux? Would you mind opening a new issue for it? |
@jabranham I remember that some commands need |
We may use the vscode package for the installation, I am planning to do that for |
@jabranham @seagle0128 I had just a minor annoyance, if you have guix or nix installed in your distro it prefer those two package-manager rather than the distro default (eg: instead of apt it installs with guix)... Opening a issue late! |
@eubarbosa No password prompt for I used |
I'm all for auto installation of language servers, with the condition that a user could customize this to turn it off and specify the language server they want to use directly. Also, I think a quicker/easier fix, should this take a little while to get done, would be to just add more detailed and exact instructions for installing each language server, so someone new to the idea of lsp would still be able to get up and running quickly |
I think providing a pointer to install instructions makes more sense. Some language servers are fairly complex to install, and may involve interaction with the system package manager. |
@alanz that's correct, I will update the feature description. In general I was referencing the following servers:
|
Lsp server may depend on per-project environment requirements (like version). |
@Pitometsu I closed as wont fix #440 which was intended to be used for testing purposes. Maybe we could have what you are suggesting as a separate issue? In this PR I am looking for more lightweight solution, similar to what you have in vscode where you just download the extension and it works, no other configurations are needed. |
VSCode offers to "install" extensions just like lsp-java as we open a .xxx file! That seems a good way to ask to install servers! |
Any update for this feature? |
We have it for fsharp/java and ms python. We have automatic installation using vscode extensions for a lot of dap-mode adapters(implemented by @kiennq ) and we could potentially use that same approach for language servers (see emacs-lsp/dap-mode#104). ATM we do not have the manpower to implement it for each server so we pretty much depend on contributions(like 99% of the FOSS projects). |
I see, is there a method that you prefer to use? Either using |
If I can put my opinion here, somethings that doesn't leave Windows user unusable would be the best. |
IMO the easiest way to support that is to follow what VScode is doing which will address also @kiennq concern. Note that some of the servers cannot be just downloaded(e. g. the C++ one). |
I'm pretty new to lsp. Do you know what do VSCode does when installing the language server? My first thought would just be an interface that controls all the installation flow to each server by just inputting the installation commands. Seconds, step will be the improvement for each language server's installation. |
My two cents. I developed the automatic server installation for |
It depends - some of the language servers are packaged in the vsix extension that is downloaded from https://marketplace.visualstudio.com/ (e. g. JDT language server) others like ms python language server are downloaded from the extension using JS code. I think that RLS is downloaded using |
Few random thoughts based on what we currently have, follow up from #1147
And what we currently have
|
I was working on an idea for installing servers using Nix: https://github.com/akirak/lsp-server.el It parses the README of I am willing to contribute to |
@akirak - using nix is a cool idea!
What do you think about having a field in the |
That would be a good idea and help develop my package. Note that some language servers are suggested for installation using a language-specific package manager. For example, the language server for Elixir can be installed using mix, but it does not seem directly available from nixpkgs. The same for Golang. I was thinking about how to handle such packages. For npm packages, I implemented a wrapper which is available as part of nix-env-install. Nix is not (officially) supported on Windows, so any Nix-based solutions should probably not be considered the official way at present. Nix on WSL does work, and there seems to be attempts to use Nix on native/mingw Windows, but I am not sure if any of them are stable. |
I do not think that we should limit the download/install options to nix. Maybe it will be the preferable way if it is present but definitely we should support other ways(e. g. Download+Extract). I think that we should change lsp-register-client to be macro generating variables e. g. (lsp-register-client
:server-id 'foo
:binary-path '("/usr/bin/foo" "--stdio")
;;:nix-package
) ... will generate: ...
(defcustom lsp-foo-binary-path '("/usr/bin/foo" "--stdio"))
... What do you think? |
@yyoncho
Yeah, I love Nix, but since it is not available for everyone, we should provide other options.
It would be a good idea. My
Language servers may not be available in the user's default The recipe overrides are defined as follows. It would be better if the default values were provided in client definitions. (defcustom lsp-server-package-alist
'((bash-ls . (npm "bash-language-server"))
(fsac . (function lsp-fsharp--fsac-install))
(elixir-ls . (error "Please install elixir-ls for yourself")))
"Alist of package specifications for servers."
:group 'lsp-server
:type '(alist :key-type symbol
:value-type sexp))
(defun lsp-server--install-with-server-spec (spec)
"Install server packages from SPEC."
(pcase spec
(`(npm . ,packages)
(if lsp-server-use-nix
(progn
(require 'nix-env-install)
(nix-env-install-npm packages))
(lsp-server--run-command (format "npm install -g %s"
(mapconcat #'shell-quote-argument
packages ' ')))))
(`(function ,func)
(funcall func))
(`(error ,msg)
(message msg))
(_
(error "Unsupported spec %s" spec)))) My package currently lets the user install servers by manually running
As for the async installation, I would like you to take a look at my implementation in nix-env-install package. It runs an external process in the background and displays the progress in another window. If you wish, I will contribute the function to your package. |
I like the idea. This will definitely go in but let's first lay down the foundation of download framework and then we will proceed with adding the concrete implementations. I will open a draft PR once I have something so you could provide your feedback. |
I've changed how nix-env-install displays process buffers and process command output. Now it uses |
I have a lot of the code already in the https://github.com/yyoncho/lsp-mode/tree/downloads . I will post a PR soon. |
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# is ported and working.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes emacs-lsp#506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
- Fixes #506 - Implemented base facilities for downloading and installing language servers - added new field :download-server-fn in lsp--client structure which will be called with (client callback update?). - Implemented automatic installation via npm for jsts-ls and ts-ls. - All servers(when feasible) should be installed under `lsp-server-install-dir`. @akirak - check the cl-defgenerics in lsp-mode - let me know if they are sufficient to implement the nix variands. @razzmatazz - I have ported CSharp implementation but I havent converted it into async. @seagle0128 - lsp-python-ms is not ported. In general, it will work as it is but it will ask to install the server even if you are in different file. @TOTBWF - F# same as C#. @kiennq powershell installation is converted to async one.
We could use https://gitlab.com/jabranham/system-packages to automatically download and install language servers that have published their packages(npm/gem/pip).
NB: the servers that does not have installation package won't be handled by this feature.
(cc @jabranham)
The text was updated successfully, but these errors were encountered: