Open MysteriousJ opened 3 years ago
Sorry for the late response, not sure if you're still experiencing this or have moved on. But anyways, that is sending a lot of requests. I personally don't use clangd so this slipped by me, the behvavior looks a lot worse.
I have made an initial attempt to address typing. We can't completely ignore updates to the highlighting during editing, but the timer period can be adjusted, if a new request comes in before the timer runs it will reset the timeout. This should result in dramatically fewer highlighting runs, obviously you won't get real-time highlight updates but that's probably fine.
The changes are on a separate branch as they are experimental: feature-mode-delay
These are new settings variables to toggle:
g:lsp_cxx_hl_delay
- this is the default timer delay, usually 10ms. I don't recommend touching it unless the others aren't working well.g:lsp_cxx_hl_use_mode_delay
- bool, whether to vary the delay based on editor modeg:lsp_cxx_hl_edit_delay_ms
- edit mode (insert/replace) delay, defaults to 1000msPlease try setting this and seeing if your situation improves:
let g:lsp_cxx_hl_use_mode_delay = 1
let g:lsp_cxx_hl_edit_delay_ms = 1000
You can play around with the edit delay to see if you prefer more or less latency.
I've been using these settings for the past week and they work great! I prefer g:lsp_cxx_hl_delay_ms
as it also makes successive normal mode operations smoother.
Highlighting is perfectly fast on small files, but once files get over 500 lines, highlighting noticeably lags for every few characters I type in insert mode. It would be great if there was a way to disable highlighting while typing, or only reapply highlighting on a function call so it could be hooked up to an autocmd.
Configuration:
CoC configuration:
Log from typing in a 1400 line file:
Log from typing in a 20 line file: