fannheyward / coc-rust-analyzer

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

overly long loop turn warning on every few keytypes #1229

Closed RustyYato closed 5 months ago

RustyYato commented 5 months ago

What's the output of :CocInfo

## versions

vim version: NVIM v0.9.5
node version: v18.15.0
coc.nvim version: 0.0.82-3dc6153a 2023-07-21 00:22:17 -0500
coc.nvim directory: /home/yato/.config/nvim/plugged/coc.nvim
term: xterm-256color
platform: linux

## Log of coc.nvim

2024-02-27T10:09:26.188 INFO (pid:8822) [plugin] - coc.nvim initialized with node: v18.15.0 after 49
2024-02-27T10:09:27.838 INFO (pid:8822) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion rust analyzer is built from source, commit: 1f54f714caf7d38aaab9ac49ba25caa5abd52937

What's your coc-rust-analyzer version? You can get it from :CocList extensions 0.75.1

I'm working on a crate that uses quote a lot for some codegen, and every few seconds I get overly long loop turn took... error which prevents me from typing and misses some keypresses. This is getting very annoying. The error message is something like this:

[coc.nvim] overly long loop turn took 133.461087ms (event handling took 133.457767ms): Request(Request { id: RequestId(I32(209)), method: "textDocument/select│
ionRange", params: Object {"textDocument": Object {"uri": String("file:///my-file-path")}, "positions": A│
rray [Object {"line": Number(149), "character": Number(20)}]} })

Is there a setting to suppress rust-analyzer logs like this? Or if there isn't, would you accept a PR to add such a setting?

fannheyward commented 5 months ago

According to https://github.com/rust-lang/rust-analyzer/issues/10120, you can use export RA_LOG=rust_analyzer=error to hide this warning. PR is welcome.

RustyYato commented 5 months ago

Oh, that thread shows that this is likely because I built from source! Yikes. Thanks for pointing out the thread. I don't think there's much that can you do here, so closing this issue.

RustyYato commented 5 months ago

Building with RA_LOG=rust_analyzer=error worked! Thanks again for the help :smile: