fannheyward / coc-texlab

TexLab extension for coc.nvim
MIT License
121 stars 3 forks source link

failure to run texlab #30

Closed teto closed 5 years ago

teto commented 5 years ago

Here is what I get after :CocInstall coc-texlab :

|| [coc.nvim] Server TexLab failed to start: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| [coc.nvim] error: Uncaught exception: Error: spawn /home/teto/.config/coc/extensions/coc-texlab-data/texlab ENOENT
||     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
||     at onErrorNT (internal/child_process.js:415:16)
||     at process._tickCallback (internal/process/next_tick.js:63:19)
|| [coc.nvim] error: UnhandledRejection: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
||     at LatexLanuageClient.createMessageTransports (/nix/store/msw262zm4fsp7mrjms6x9kkldjigrlvd-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)
|| [coc.nvim] Installed extension: coc-texlab
|| [coc.nvim] error: UnhandledRejection: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
||     at LatexLanuageClient.createMessageTransports (/nix/store/msw262zm4fsp7mrjms6x9kkldjigrlvd-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)
|| UnhandledRejection: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
||     at LatexLanuageClient.createMessageTransports (/nix/store/msw262zm4fsp7mrjms6x9kkldjigrlvd-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)
|| [coc.nvim] Server TexLab failed to start: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| [coc.nvim] error: Uncaught exception: Error: spawn /home/teto/.config/coc/extensions/coc-texlab-data/texlab ENOENT
||     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
||     at onErrorNT (internal/child_process.js:415:16)
||     at process._tickCallback (internal/process/next_tick.js:63:19)
|| UnhandledRejection: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
||     at LatexLanuageClient.createMessageTransports (/nix/store/msw262zm4fsp7mrjms6x9kkldjigrlvd-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)

and the file

file /home/teto/.config/coc/extensions/coc-texlab-data/texlab                                                                                                                                                                                                     
/home/teto/.config/coc/extensions/coc-texlab-data/texlab: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=50bdeb375c70028854fce2768ffa250cc3b62a09, with debug_info, not stripped

Do I miss a binary ? I am not familiar with the nodejs ecosystem, can it be due to a version mismatch ?

fannheyward commented 5 years ago

I need some info to check:

  1. Does your texlab binary works ok? You can check it with /home/teto/.config/coc/extensions/coc-texlab-data/texlab -h, texlab version and help info will be printed if success.
  2. After open a tex file, :CocInfo please
teto commented 5 years ago

so it's kind of weird because the file can be opened via vim/file but if I try to start the

teto@jedha> file ~/.config/coc/extensions/coc-texlab-data/texlab                                                                                                                                                                                                              
/home/teto/.config/coc/extensions/coc-texlab-data/texlab: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=50bdeb375c70028854fce2768ffa250cc3b62a09, with debug_info, not stripped
teto@jedha> chmod +x  ~/.config/coc/extensions/coc-texlab-data/texlab                                                                                                                                                                                                         
teto@jedha> ~/.config/coc/extensions/coc-texlab-data/texlab                                                                                                                                                                                                                   
zsh: no such file or directory: /home/teto/.config/coc/extensions/coc-texlab-data/texlab
[127] teto@jedha> ll ~/.config/coc/extensions/coc-texlab-data/                                                                                                                                                                                                                
total 25296
-rwxr-xr-x 1 teto users 25900096 07-24 03:44 texlab
teto@jedha> ll ~/.config/coc/extensions/coc-texlab-data/texlab                                                                                                                                                                                                                
[130] teto@jedha> readlink -f ~/.config/coc/extensions/coc-texlab-data/texlab                                                                                                                                                                                                 
/home/teto/.config/coc/extensions/coc-texlab-data/texlab

tab completion completes the filename as well so the file is present seems like I am hitting: https://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists

Output of CocInfo:

## versions

vim version: NVIM v0.4.0-dev
node version: v10.16.0
coc.nvim version: 0.0.73-56825890dc
term: xterm-termite
platform: linux

## Messages
"pathmanager.tex" 1114L, 74867C
[coc.nvim] Server TexLab failed to start: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
[coc.nvim] error: Uncaught exception: Error: spawn /home/teto/.config/coc/extensions/coc-texlab-data/texlab ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
[coc.nvim] error: UnhandledRejection: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
    at LatexLanuageClient.createMessageTransports (/nix/store/msw262zm4fsp7mrjms6x9kkldjigrlvd-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)
## Output channel: snippets

## Output channel: TexLab

[Error  - 17:04:20] Starting client failed: 
Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
    at LatexLanuageClient.createMessageTransports (/nix/store/msw262zm4fsp7mrjms6x9kkldjigrlvd-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)

## Output channel: highlight

[Info  - 17:04:20] Highlight server running in node v10.16.0
fannheyward commented 5 years ago

Looks like the texlab server file is broken. Try latex.UpdateLanguageServer to download new release, or download from https://github.com/latex-lsp/texlab/releases and put into ~/.config/coc/extensions/coc-texlab-data/texlab

teto commented 5 years ago

How can i run the command in ex mode ? Didn t find out

fannheyward commented 5 years ago

You can use :CocCommand latex.UpdateLanguageServer in ex mode.

teto commented 5 years ago

Hi I run that command. Coc returns coc.nvim] Update TexLab Server success, yet I still have :

|| [coc.nvim] Server TexLab failed to start: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| [coc.nvim] error: Uncaught exception: Error: spawn /home/teto/.config/coc/extensions/coc-texlab-data/texlab ENOENT
||     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
||     at onErrorNT (internal/child_process.js:415:16)
||     at process._tickCallback (internal/process/next_tick.js:63:19)
|| [coc.nvim] error: UnhandledRejection: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
|| Error: Launching server using command /home/teto/.config/coc/extensions/coc-texlab-data/texlab failed.
||     at LatexLanuageClient.createMessageTransports (/nix/store/advvqcczsliqdagwcx7c1impr6vbama4-vimplugin-coc-nvim-0.0.73/share/vim-plugins/coc-nvim/build/index.js:72369:23)
doronbehar commented 5 years ago

@teto texlab is now packaged in NixOS, see https://github.com/NixOS/nixpkgs/pull/73087 . Hence it shouldn't be a problem running it if installed with nix-env. However, From some reason coc-texlab still doesn't detect texlab in my $PATH and so the workaround I've come up with was linking ~/.nix-profile/bin/texlab to ~/.config/coc/extensions/coc-texlab-data/texlab

BTW, I really like coc-texlab so far, it's so much faster then coc-vimtex!

sumnerevans commented 3 years ago

I got it to work on NixOS using the following in my shell.nix file:

    shellHook = let
      # CoC Config
      cocConfig = {
        "texlab.path" = "${pkgs.texlab}/bin/texlab";
      };
    in
      ''
        mkdir -p .vim
        echo '${builtins.toJSON cocConfig}' | ${pkgs.jq}/bin/jq > .vim/coc-settings.json
      '';

See: https://gitlab.com/sumner/lug-gui-toolkits/-/commit/0fb53c85a5ce955d18123fdfdeebcf1598c4ad90#1c8850d899c3d82e376483b81036f45e579d8afe for full context.