emacs-languagetool/lsp-ltex

New version of lsp-ltex is not started

linwaytin opened this issue · 14 comments

Several days ago I updated all packages, including this one.
I found lsp-ltex is not started after the update, without error messages.
It was fine before. Is there change that could possibly cause this issue?
Thanks!

I think it was cause by the update functionality. Can you try removing the language server manually? It should located under ~/.emacs.d/.cache/lsp/ltex-ls. And install the language server once again, using command M-x lsp-isntall-server.

I actually have done that, but it is still not started.

Does it not installed?

It downloaded the tar file but did not unzip it. I unzipped the tarball, but the lsp does not run the server.

Hmmm... Can you eval the following snippet? (From L315-L322)

(let* ((tar (lsp-ltex--downloaded-extension-path))
              (dest (f-dirname tar))
              (output (f-join dest lsp-ltex--filename)))
         (if (lsp-ltex--execute "tar" "-xvzf" tar "-C" dest)
             (unless (lsp-ltex--execute (if (eq system-type 'windows-nt) "ren" "mv")
                                        output "latest")
               (error "Failed to rename version `%s` to latest" lsp-ltex-version))
           (error "Error during the unzip process: tar")))

This should just untar and rename the folder to latest. The server isn't starting because it is looking for the folder latest, and no longer the original folder name.

I tried it, and it seems nothing happened.
I have already had ltex-ls-12.3.0.tar.gz in my .cache/lsp/ltex-ls.
Can I just unzip the tarball and rename it to latest?

I tried it, and it seems nothing happened.

I have already had ltex-ls-12.3.0.tar.gz in my .cache/lsp/ltex-ls.

Can I just unzip the tarball and rename it to latest?

Yes, you could but you would not get the latest update by this package. Can you tell me what OS you are on? So I can solve it on the local machine.

Yes, my OS is Manjaro linux. Emacs is 27.2.

I just deleted all folders and files under ltex-ls and run lsp-install-server again.
This time I got

LSP :: Server ltex-ls install process failed with the following error message: (error Failed to rename version ‘12.3.0‘ to latest).

The tarball is unzipped, but the folder name is still ltex-ls-12.3.0.

The issue is the mv command, but I don't have a macOS at the moment. Can you try to message out the output variable? We need to make sure both paths (output and latest) to rename are correct.

I have Linux, not macOS.

The output variable is "~/.emacs.d/.cache/lsp/ltex-ls/ltex-ls-12.3.0".

I think I figure out what's going on.
The command mv path-to-dir latest does not work if the directory is not in the current directory.
Something like mv ~/.emacs.d/.cache/lsp/ltex-ls/ltex-ls-12.3.0 ~/.emacs.d/.cache/lsp/ltex-ls/latest works.

I have Linux, not macOS.

Oops, sorry I overlooked your message!

@linwaytin Thanks for the information! I have applied a fix in d9148a6. Evaluate the following to check to see if it works!

(let* ((tar (lsp-ltex--downloaded-extension-path))
              (dest (f-dirname tar))
              (output (f-join dest lsp-ltex--filename))
              (latest (f-join (f-dirname output) "latest")))
         (if (lsp-ltex--execute "tar" "-xvzf" tar "-C" dest)
             (unless (lsp-ltex--execute (if (eq system-type 'windows-nt) "move" "mv")
                                        output latest)
               (error "Failed to rename version `%s` to latest" lsp-ltex-version))
           (error "Error during the unzip process: tar")))

It works! Thank you for such a quick fix.