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

Feature Request: Distribute Through Hex #572

Closed
LandonSchropp opened this issue Jul 14, 2021 · 6 comments
Closed

Feature Request: Distribute Through Hex #572

LandonSchropp opened this issue Jul 14, 2021 · 6 comments

Comments

@LandonSchropp
Copy link

With other language servers, I'm usually able to install them via the language's package manager. For example, in Node.js I can install the language server package via Yarn or NPM:

yarn add -D javascript-typescript-langserver

And in Ruby I can put it in my Gemfile like so:

gem 'solargraph', group: :development

I was a bit surprised to see that elixir-ls isn't distributed via Hex. (Apologies if it is. I didn't see it in hex or in the docs.) I would expect to be able to do something like this:

defp deps do
  [
    ...
    {:elixir_ls, "..."}
  ]
end

The advantage of this approach is I can install the language server on a per-project basis, with different versioning as needed. My editor can easily be configured to use a local version of a package rather than a global version, and installation becomes a snap.

@LandonSchropp LandonSchropp changed the title Distribute through Hex? Feature request: Distribute Through Hex Jul 14, 2021
@LandonSchropp LandonSchropp changed the title Feature request: Distribute Through Hex Feature Request: Distribute Through Hex Jul 14, 2021
@axelson
Copy link
Member

axelson commented Jul 18, 2021

Hi, thanks for bringing this up 👍
Indeed ElixirLS is currently not available via hex. It would be nice to be able to specify the version of ElixirLS to use via the project deps, although it is important to me to do it in a way that would not require ElixirLS to be specified in the project deps (otherwise I wouldn't be able to use ElixirLS on any Elixir project that I want). But I do think that it would be great to be able to use ElixirLS in that way.

@LandonSchropp
Copy link
Author

Thanks for the reply @axelson! Is there anything I can do to help in setting this up? I'm sure you'll want to own the account that actually controls the package, but I'm happy to do any leg work you'd find helpful to get this working.

@axelson
Copy link
Member

axelson commented Jul 24, 2021

It should all be possible with git dependencies (https://elixir-lang.org/getting-started/mix-otp/dependencies-and-umbrella-projects.html) so you wouldn't even need to create a hex package when setting it all up.

Also it may be worthwhile to read this packaging issue and related discussion:
#115

@LandonSchropp
Copy link
Author

LandonSchropp commented Aug 23, 2021

@axelson Sorry for the slow reply on this! This issue fell off my radar.

You're right, this is totally possible using a Git in the package manager. The big downside to this is you'd lose Hex's version management. It's possible to specify a specific commit or tag when listing the package, but mix deps.update wouldn't work for patches or minor version bumps. You could also use a branch dependency, but if anything go wrong on a development branch or isn't perfect, then you're pulling those issues into your branch. You also lose the benefit of semantic versioning with the Git approach.

I think the package manager solves these issues, so if you're open to it, that approach feels cleaner.

I read through the discussion you posted. Sorry for missing that before! If you'd like, I'd be happy to move this discussion there.

I think I find myself agreeing with @tomekowal's thoughts there:

I wonder if it would be possible to go one step further and make elixir_ls dev dependency of a project, like credo or dialyxir. It would guarantee, elixir_lsp uses the same version of Erlang/Elixir and JSON libraries as the project. It seems simpler to me than a global server with multiple instances running different Elixir versions communicating with it.

This is what I'd expect when compared to other languages' language servers.

If you're up for a Hex package, is there anything specific you'd like me to tackle? I'd imagine you'd want to own the Hex accounts for the package. I could configure the mix.exs file if you'd like and look into anything else required. I haven't personally set up a Hex package before, but I'd imagine it isn't much different than a Node package or a Ruby gem.

@mpmiszczyk
Copy link

I think that much greater benefit of distributing trough hex would be ability to use the Mix.install function. This could be combined with elixir version managers and ensure that your server will be using same version of the Elixir as an given project.

@lukaszsamson
Copy link
Collaborator

This is not currently planned

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