Language Server is lagging sometimes

Hello everyone.
I have this issue with julia vscode, when after some time after the start of the extension becomes very very slow and barely usable. For example, if I hit ctrl+enter on function definition, I get updated version of the function maybe after 10-15 seconds.
I looked into extension’s code (main.jl file and LanguageServer.jl there) and added some statements into request_wrapper() to see which requests took too much time to execute. I got the following:

┌ Warning: request took too long
│   duration = 2032 milliseconds
│   params = LanguageServer.DidChangeTextDocumentParams
│   combined_msg_queue = Channel{Any}(9223372036854775807) (91 items available)
└ @ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.126.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:314
┌ Warning: request took too long
│   duration = 2524 milliseconds
│   params = LanguageServer.DidChangeTextDocumentParams
│   combined_msg_queue = Channel{Any}(9223372036854775807) (107 items available)
└ @ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.126.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:314
┌ Warning: request took too long
│   duration = 3026 milliseconds
│   params = LanguageServer.DidChangeTextDocumentParams
│   combined_msg_queue = Channel{Any}(9223372036854775807) (39 items available)
└ @ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.126.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:314
┌ Warning: request took too long
│   duration = 3061 milliseconds
│   params = LanguageServer.DidChangeTextDocumentParams
│   combined_msg_queue = Channel{Any}(9223372036854775807) (51 items available)
└ @ LanguageServer ~/.vscode/extensions/julialang.language-julia-1.126.2/scripts/packages/LanguageServer/src/languageserverinstance.jl:314

I also added statements to figure out why those requests took so long, but didn’t get much out of it. Rarely I see that parse_all!() and lint!() calls take about 1 second, but thats it.

Note, there are always some messages pending in combined_msg_queue, when request takes too long.

I haven’t had time to dig deeper, but would be happy to, if anyone could guide me.


I’m using julia 1.10.5 and extension 1.126.2 or 1.124.2

1 Like