fannheyward / coc-rust-analyzer

rust-analyzer extension for coc.nvim
MIT License
1.13k stars 39 forks source link

Diagnostics do not work on other files or in other windows. #1124

Closed ElcomJ closed 1 year ago

ElcomJ commented 1 year ago

Recently I've been noticing this problem, which occurs when I need to work with several files or several windows at the same time.

Whenever I open a file and modify it, the diagnostics work normally, but if I close this file and open another, it stops working. The same happens if I work with several windows, only in the first window that I opened that the diagnostics work.

I will leave two videos below with the error occurring with the two occasions:

Multiple files in one window:

https://user-images.githubusercontent.com/37147897/225023639-a5b9d88f-4b09-4069-bb37-f82d631ba630.mp4

Multiple files in multiple windows:

https://user-images.githubusercontent.com/37147897/225023886-d32b9d5a-7090-41b0-8aad-a49144b87294.mp4

PS: I already tested using clangd, and there it works normally, the error only occurs in rust-analyzer.

fannheyward commented 1 year ago

Can't reproduce, maybe something broken with your rust-analyzer, what's your rust-analyzer --version?

ElcomJ commented 1 year ago

My version of rust-analyzer is the most current one, because I have installed the one that the extension itself suggests installing when it doesn't have bin, and whenever it recommends a new update I install it through coc-rust-analyzer.

Could the problem be coming from the rust-analyzer which is installed by coc-rust-analyzer ?

fannheyward commented 1 year ago

Have no idea about this, set "rust-analyzer.trace.server": "verbose" in your coc-settings.json, then check :CocCommand workspace.showOutput rust-analyzer.

ElcomJ commented 1 year ago

@fannheyward The output was more than 3000 lines, I will be attaching a document with it so I don't post it here.

I did the same action as for the videos of multiple files on one screen.

File below:

Output_coc_rust_analyzer.pdf

ElcomJ commented 1 year ago

@fannheyward I found out that this problem occurs only in separate files, in Cargo projects the diagnostics works normally for multiple files in one or multiple windows.

I will be closing this commit, since I already found out the reason of the problem.

Thanks for your attention and have a great day.

PS: Thanks and congratulations for the great plugin.