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

[POC] Support installing the server with custom version #425

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mracos
Copy link
Contributor

@mracos mracos commented May 25, 2021

Why?

There are some LSP servers that have a steady update rate, and in order to not flood this repository with PR just to update the version I through that having custom-defined versions to install would be nice

How it's done?

First we need to add the configuration as a version key in the language server configuration, for example:

let g:lsp_settings = { 'clojure-lsp': { 'version': '2021.05.22-16.50.45' } }

Then this version is retrieved in the language-server install process and is passed to the installer script as an argument when called, e.g. installer/install-clojure-lsp.sh 2021.05.22-16.50.45

Not sure if this the best approach ☝️ but is the one with the smaller footprint that I could think of

I already changed the clojure-lsp installer to test this approach and has worked nicely.

Caveats

Each installer script (that install a specific version) would need to be changed in order to support this custom version argument, however, it would not break for current not changed installer scripts since the argument would be ignored

Next steps?

Not sure, maybe change all installer scripts to support this argument? Another different approach? Being ok with having to send PRs to this repository

Update: kinda related to #311?

- How it's done?

First we need to add the configuration as a `version` key in the
language server configuration, for example:

```vim
let g:lsp_settings = { 'clojure-lsp': { 'version': '2021.05.22-16.50.45' } }
```

Then this version is retrieved in the language-server install process,
and is passed to the installer script as an argument when called, e.g.

`installer/install-clojure-lsp.sh 2021.05.22-16.50.45`

- Caveats

Each installer script would need to be changed in order to support
this argument as a custom version, however, it would not break for
current not changed installer scripts since the argument would be
ignored
@@ -1,5 +1,5 @@
@echo off

setlocal
set VERSION=2021.02.01-20.37.52
set VERSION=%1:-2021.02.01-20.37.52%
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea if this works, I used this tool to convert a bash expression to a bat one haha

@mattn
Copy link
Owner

mattn commented Jun 7, 2021

Seems good for me.

@mracos
Copy link
Contributor Author

mracos commented Jun 7, 2021

Great! I'll in the next following days:

  1. Add support for the version argument to language server installer scripts that install a specific version (and check if it could work for ones that install directly from main)
  2. Add some documentation and examples around this new option that can be passed to language servers in g:lsp_settings

Maybe I'm missing something? Do you see anything else that could be done?

@mattn
Copy link
Owner

mattn commented Jun 8, 2021

Maybe I'm missing something? Do you see anything else that could be done?

I think this is good. But I wonder some installers always install latest version. What should do in this PR for them.

@mracos
Copy link
Contributor Author

mracos commented Jun 9, 2021

I think this is good. But I wonder some installers always install latest version. What should do in this PR for them.

The only case where I see that we would have some work is installer scripts that do not support a specific version (solargraph for example), we could change them to install from channels where we can pass a specific version but default to lastest.

In other cases where the script already supports but only chooses to pass the latest (e.g. scripts that download from github releases), we can just pass the specific version defaulting to lastest.

WDYT, does it make sense?

@mattn
Copy link
Owner

mattn commented Jul 20, 2021

I would like to gather the opinions of other's for this. Anyone, thought?

@mracos
Copy link
Contributor Author

mracos commented Jul 20, 2021

Maybe an alternative would be to always try and install the latest lsp server instead of having to support custom versions.

For example, my use case used to be that the version for clojure-lsp pinned here was behind at least by a couple of versions, where the newer ones had fixes that made a huge difference.

If we always install the latest for all plugins, I could just run LspInstallServer and everything would be rainbows.

WDYT?

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

Successfully merging this pull request may close these issues.

2 participants