fsharp / emacs-fsharp-mode

F# Emacs mode
Apache License 2.0
208 stars 62 forks source link

Add a possibility to update LSP server #228

Closed juergenhoetzel closed 1 year ago

juergenhoetzel commented 4 years ago

eglot-fsharp automatically installs the fsautocomplete.exe LSP server. But there is no way to update this fsautocomplete.exe.

TOTBWF commented 4 years ago

I have some code in lsp-mode for auto-updating if you want to use that as a base. It should be available here: https://github.com/emacs-lsp/lsp-mode/blob/85682e663fe4307f890a65ef207fbe03eb506724/lsp-fsharp.el#L191

juergenhoetzel commented 4 years ago

I have some code in lsp-mode for auto-updating if you want to use that as a base. It should be available here: https://github.com/emacs-lsp/lsp-mode/blob/85682e663fe4307f890a65ef207fbe03eb506724/lsp-fsharp.el#L191

Thanks! I was thinking about a way to update only when the remote version is newer.

Sadly url-copy-file has no options to specify cache headers and also is blocking Emacs while downloading:

(benchmark 1 '(url-copy-file "https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/fsautocomplete.netcore.zip?branch=master"  "/tmp/out.zip" t))
"Elapsed time: 82.575172s (0.397937s in 7 GCs)"

I thought about shelling out to curl to use cache headers but that would be platform-dependent:

time curl   -s --time-cond out.zip  -L -o /tmp/out.zip "https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/fsautocomplete.netcore.zip?branch=master"
real    0m1,953s
user    0m0,027s
sys 0m0,010s

@Krzysztof-Cieslak @enricosada would it be possible to publish fsautocomplete.exe as a dotnet tool to simplify the installation and enable a simple dotnet tool update?

juergenhoetzel commented 1 year ago

Already implemented by 9f2ed8e6ff6855ef109b9ea1308a7c8e2709c624