neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.36k stars 956 forks source link

同时打开多个lsp时,会让rust-analyzer中断 #4927

Closed zhruith closed 4 months ago

zhruith commented 7 months ago

在tauri-app项目中,有vue、ts和rust,在先打开vue或ts文件,启动他们的lsp后,再打开rust文件,rust-analyzer启动就会失败。 但是如果先打开rust-analyzer就不会有这个问题。 在windows下和linux都会出现这个情况。

可以确定的是各个语言的lsp都没有问题,在helix下,打开tauri-app项目不会出现这样的问题。 所以,基本可以断定是coc-nvim的这边出了问题。

zhruith commented 7 months ago

[Error - 21:53:04.779] Sending request textDocument/documentHighlight failed. │ 2 Message: canceled by client │ 3 Code: -32800

这是workspace.showoutput输出的错误

fannheyward commented 7 months ago

request textDocument/documentHighlight failed

这个报错无关,可以忽略。贴一下 :CocInfo

zhruith commented 7 months ago

这是完整的CocInfo,启动顺序为vue -> ts -> rust, rust 看起来没报错,但是lsp的服务都用不了了,使用K时,显示hover not found:

versions

vim version: NVIM v0.9.5 node version: v21.6.2 coc.nvim version: 0.0.82-00bd79e0 2024-02-28 12:40:55 +0800 coc.nvim directory: C:\Users\zhrui.vim\plugged\coc.nvim term: undefined platform: win32

Log of coc.nvim

2024-03-07T15:29:29.858 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:29.969 WARN (pid:10672) [workspace] - Extension "coc-lists" registered synchronized autocmd "VimLeavePre", which could be slow. 2024-03-07T15:29:30.071 INFO (pid:10672) [plugin] - coc.nvim initialized with node: v21.6.2 after 335 2024-03-07T15:29:30.249 INFO (pid:10672) [attach] - receive notification: openList [ 'files' ] 2024-03-07T15:29:34.903 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:34.936 INFO (pid:10672) [services] - LanguageClient Vue Semantic Server state change: stopped => starting 2024-03-07T15:29:34.939 INFO (pid:10672) [services] - LanguageClient Vue Syntactic Server state change: stopped => starting 2024-03-07T15:29:34.947 INFO (pid:10672) [language-client-index] - Language server "vue-semantic-server" started with 10924 2024-03-07T15:29:34.958 INFO (pid:10672) [language-client-index] - Language server "vue-syntactic-server" started with 15992 2024-03-07T15:29:35.756 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:36.314 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:36.490 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:36.650 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:37.063 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:37.303 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:37.638 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:37.860 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:38.401 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:38.657 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:39.261 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:39.437 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:39.613 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:40.346 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:40.889 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:41.224 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:41.688 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:41.989 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:42.293 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:42.644 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:42.673 INFO (pid:10672) [services] - LanguageClient Vue Semantic Server state change: starting => running 2024-03-07T15:29:42.682 INFO (pid:10672) [services] - service vue-semantic-server started 2024-03-07T15:29:42.683 INFO (pid:10672) [services] - LanguageClient Vue Syntactic Server state change: starting => running 2024-03-07T15:29:42.685 INFO (pid:10672) [services] - service vue-syntactic-server started 2024-03-07T15:29:43.942 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:44.289 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:44.535 INFO (pid:10672) [attach] - receive notification: doHover [] 2024-03-07T15:29:44.701 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:45.441 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:45.899 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:46.310 INFO (pid:10672) [attach] - receive notification: openList [ 'files' ] 2024-03-07T15:29:52.244 INFO (pid:10672) [services] - service tsserver started 2024-03-07T15:29:52.246 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:54.539 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:54.963 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:55.496 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:55.887 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:56.106 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:56.312 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:57.361 INFO (pid:10672) [attach] - receive notification: openList [ 'files' ] 2024-03-07T15:29:59.672 INFO (pid:10672) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting 2024-03-07T15:29:59.681 INFO (pid:10672) [language-client-index] - Language server "rust-analyzer" started with 2360 2024-03-07T15:29:59.760 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:29:59.815 INFO (pid:10672) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running 2024-03-07T15:29:59.818 INFO (pid:10672) [services] - service rust-analyzer started 2024-03-07T15:30:06.759 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:07.026 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:07.292 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:07.541 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:08.056 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:08.462 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:08.679 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:08.866 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:09.039 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:09.244 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:15.060 INFO (pid:10672) [attach] - receive notification: showInfo [] 2024-03-07T15:30:15.228 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:17.767 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:18.098 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:18.426 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:18.710 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:19.540 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:19.965 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:20.277 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:20.951 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:23.260 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:26.553 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:26.884 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:36.455 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:37.474 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:38.316 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:38.928 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:39.946 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:40.152 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:40.274 INFO (pid:10672) [attach] - receive notification: doHover [] 2024-03-07T15:30:40.435 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:41.745 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:42.029 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:42.388 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:43.741 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:44.304 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:44.824 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:45.468 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:49.229 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:49.982 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:50.674 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:51.015 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:53.197 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:58.150 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:30:59.197 INFO (pid:10672) [attach] - receive notification: highlight [] 2024-03-07T15:31:00.973 INFO (pid:10672) [attach] - receive notification: showInfo []

zhruith commented 7 months ago

这是wsl下的ubuntu:

versions

vim version: NVIM v0.9.5 node version: v18.19.1 coc.nvim version: 0.0.82-00bd79e0 2024-02-28 12:40:55 +0800 coc.nvim directory: /home/robert/.vim/plugged/coc.nvim term: xterm-256color platform: linux

Log of coc.nvim

2024-03-07T15:39:17.906 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:17.989 INFO (pid:1212) [attach] - receive notification: openList [ 'files' ] 2024-03-07T15:39:18.078 WARN (pid:1212) [workspace] - Extension "coc-lists" registered synchronized autocmd "VimLeavePre", which could be slow. 2024-03-07T15:39:18.144 INFO (pid:1212) [plugin] - coc.nvim initialized with node: v18.19.1 after 563 2024-03-07T15:39:21.810 INFO (pid:1212) [services] - LanguageClient Vue Semantic Server state change: stopped => starting 2024-03-07T15:39:21.812 INFO (pid:1212) [services] - LanguageClient Vue Syntactic Server state change: stopped => starting 2024-03-07T15:39:21.820 INFO (pid:1212) [language-client-index] - Language server "vue-semantic-server" started with 1259 2024-03-07T15:39:21.835 INFO (pid:1212) [language-client-index] - Language server "vue-syntactic-server" started with 1260 2024-03-07T15:39:21.928 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:23.017 INFO (pid:1212) [services] - LanguageClient Vue Semantic Server state change: starting => running 2024-03-07T15:39:23.031 INFO (pid:1212) [services] - service vue-semantic-server started 2024-03-07T15:39:23.032 INFO (pid:1212) [services] - LanguageClient Vue Syntactic Server state change: starting => running 2024-03-07T15:39:23.035 INFO (pid:1212) [services] - service vue-syntactic-server started 2024-03-07T15:39:23.251 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:23.464 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:23.739 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:24.139 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:24.565 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:24.929 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:25.251 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:25.476 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:26.125 INFO (pid:1212) [attach] - receive notification: doHover [] 2024-03-07T15:39:26.302 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:26.816 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:27.250 INFO (pid:1212) [attach] - receive notification: openList [ 'files' ] 2024-03-07T15:39:30.809 INFO (pid:1212) [services] - service tsserver started 2024-03-07T15:39:30.833 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:32.040 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:32.355 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:32.578 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:32.791 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:33.316 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:35.326 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:35.887 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:37.687 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:38.215 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:39.575 INFO (pid:1212) [attach] - receive notification: openList [ 'files' ] 2024-03-07T15:39:43.924 INFO (pid:1212) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting 2024-03-07T15:39:43.942 INFO (pid:1212) [language-client-index] - Language server "rust-analyzer" started with 1388 2024-03-07T15:39:44.034 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:44.151 INFO (pid:1212) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running 2024-03-07T15:39:44.157 INFO (pid:1212) [services] - service rust-analyzer started 2024-03-07T15:39:49.732 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:50.020 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:50.395 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:50.645 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:51.150 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:52.112 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:52.399 INFO (pid:1212) [attach] - receive notification: highlight [] 2024-03-07T15:39:54.655 INFO (pid:1212) [attach] - receive notification: doHover [] 2024-03-07T15:39:54.809 INFO (pid:1212) [attach] - receive notification: highlight []

fannheyward commented 7 months ago

应该是 rust-analyzer 没有找到正确的 workspace root,在排查中。

fannheyward commented 4 months ago

This has been fixed in coc-rust-analyzer v0.75.4, run :CocUpdate to upgrade the extension.

fannheyward commented 4 months ago

The cause of the issue: coc-rust-analyzer will check the rust file runs in standalone mode or not with workspace root, for monorepo project, coc.nvim detected multiples workspace root, but coc-rust-analyzer used to only check the first one.

zhruith commented 4 months ago

Got it, thanks.