fannheyward / coc-texlab

TexLab extension for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support M1/M2

logston opened this issue · comments

2023-09-08T15:36:03.575 INFO (pid:31636) [extension:coc-git] - Looking for git in: git
2023-09-08T15:36:03.610 INFO (pid:31636) [plugin] - coc.nvim initialized with node: v18.17.1 after �[33m112�[39m
2023-09-08T15:36:03.610 INFO (pid:31636) [services] - LanguageClient TexLab state change: stopped => starting
2023-09-08T15:36:03.613 INFO (pid:31636) [services] - LanguageClient TexLab state change: starting => stopped
2023-09-08T15:36:03.614 ERROR (pid:31636) [services] - Server texlab failed to start: Error: spawn Unknown system error -86
�[90m    at ChildProcess.spawn (node:internal/child_process:413:11)�[39m
�[90m    at Object.spawn (node:child_process:757:9)�[39m
    at /Users/paul/.local/share/nvim/plugged/coc.nvim/build/index.js:244:6310
    at async LatexLanguageClient.createConnection (/Users/paul/.local/share/nvim/plugged/coc.nvim/build/index.js:240:15149)
    at async LatexLanguageClient._start (/Users/paul/.local/share/nvim/plugged/coc.nvim/build/index.js:240:7683)
    at async Object.start (/Users/paul/.local/share/nvim/plugged/coc.nvim/build/index.js:245:5336) {
  errno: �[33m-86�[39m,
  code: �[32m'Unknown system error -86'�[39m,
  syscall: �[32m'spawn'�[39m
}
2023-09-08T15:36:03.815 INFO (pid:31636) [attach] - receive notification: highlight []
2023-09-08T15:36:17.598 INFO (pid:31636) [attach] - receive notification: openLog []

This is due to the texlab file pulled down from latex-lsp/texlab being x86:

https://github.com/fannheyward/coc-texlab/blob/master/src/downloader.ts#L40-L42

$ file /Users/paul/.dotfiles/neovim/.config/coc/extensions/coc-texlab-data/texlab
/Users/paul/.dotfiles/neovim/.config/coc/extensions/coc-texlab-data/texlab: Mach-O 64-bit executable x86_64

But latex-lsp/texlab now supports apple silicon: https://github.com/latex-lsp/texlab/releases/

Placing an Arm64 build at the same path fixes the issue:

$ file /Users/paul/.dotfiles/neovim/.config/coc/extensions/coc-texlab-data/texlab
/Users/paul/.dotfiles/neovim/.config/coc/extensions/coc-texlab-data/texlab: Mach-O 64-bit executable arm64
2023-09-08T15:40:37.926 INFO (pid:32820) [extension:coc-git] - Looking for git in: git
2023-09-08T15:40:37.961 INFO (pid:32820) [plugin] - coc.nvim initialized with node: v18.17.1 after �[33m113�[39m
2023-09-08T15:40:37.961 INFO (pid:32820) [services] - LanguageClient TexLab state change: stopped => starting
2023-09-08T15:40:37.965 INFO (pid:32820) [language-client-index] - Language server "texlab" started with 32859
2023-09-08T15:40:38.079 INFO (pid:32820) [services] - LanguageClient TexLab state change: starting => running
2023-09-08T15:40:38.081 INFO (pid:32820) [services] - service texlab started
2023-09-08T15:40:38.166 INFO (pid:32820) [attach] - receive notification: highlight []
2023-09-08T15:40:41.808 INFO (pid:32820) [attach] - receive notification: highlight []
2023-09-08T15:40:48.014 INFO (pid:32820) [attach] - receive notification: openLog []

Try coc-texlab v3.3.0