It also happens in VS Code (the hover should show an unused local diagnostic):
I checked different versions and this behavior was introduced in 3.6.0 (3.5.6 worked as expected).
I spent some time tracing it down and it when there's a single file, it seems like the reload event gets dropped by this code in provider/diagnostic.lua:526
function m.awaitDiagnosticsScope(suri, callback)
local scp = scope.getScope(suri)
if scp.type == 'fallback' then
return
end
Commenting out the if check fixes it but I'm not sure if that would have other negative consequences.
Log File
NOTE: to make log file fit in 65k I couldn't use loglevel=trace and I had to remove all lines with Cellar to eliminate anything part of the base nvim install
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Diagnostics/Syntax Checking
Expected Behaviour
Diagnostics are displayed after "workspace" is loaded
Actual Behaviour
No diagnostics are displayed after the "workspace" is loaded.
Saving the file (before making any edits) does not cause the diagnostics to show up.
Entering insert mode, making a change, and then leaving insert mode causes the diagnostics to show up:
Reproduction steps
local asd = 123
in it (i.e. an unused local)Additional Notes
This reddit thread is where it originally came up and has a little more context.
Here's a video of the behavior: https://www.youtube.com/watch?v=UE95YJ6MFAQ
It also happens in VS Code (the hover should show an unused local diagnostic):
I checked different versions and this behavior was introduced in 3.6.0 (3.5.6 worked as expected).
I spent some time tracing it down and it when there's a single file, it seems like the reload event gets dropped by this code in
provider/diagnostic.lua:526
Commenting out the if check fixes it but I'm not sure if that would have other negative consequences.
Log File
NOTE: to make log file fit in 65k I couldn't use loglevel=trace and I had to remove all lines with Cellar to eliminate anything part of the base nvim install