Hi all,
When writing a viewing/writing a benign generator expression in Julia in VSCode, the Language Server crashes repeatedly making developing impossible. I am using the Julia extension 1.6.3 at the moment, with Julia 1.7.2.
I believe I have isolated the offending code below:
(
(start:(start + l))
for start in 1:20 for l in 7:13
if begin
if (start + l) <= 20
(start + l) % 2 == 0
else
false
end
end
)
Note that the code is valid Julia, but the language server doesn’t like it for some reason. I’m hypothesising that it is something to do with the linter or syntax highlighting
In the VSCode Output view, the Julia Language Server emits the following:
┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\error_handler.jl:15
ERROR: offset[2983] > sizeof(content)[2843]
Stacktrace:
[1] get_position_at(doc::LanguageServer.Document, offset::Int64)
@ LanguageServer c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\document.jl:233
[2] Range
@ c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\document.jl:255 [inlined]
[3] (::LanguageServer.var"#180#181"{Vector{LanguageServer.DocumentHighlight}, LanguageServer.Document})(ref::CSTParser.EXPR, doc1::LanguageServer.Document, o::Int64)
@ LanguageServer c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\requests\highlight.jl:10
[4] for_each_ref(f::LanguageServer.var"#180#181"{Vector{LanguageServer.DocumentHighlight}, LanguageServer.Document}, identifier::CSTParser.EXPR)
@ LanguageServer c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\requests\features.jl:271
[5] textDocument_documentHighlight_request(params::LanguageServer.DocumentHighlightParams, server::LanguageServerInstance, conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint})
@ LanguageServer c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\requests\highlight.jl:7
[6] (::LanguageServer.var"#97#98"{typeof(LanguageServer.textDocument_documentHighlight_request), LanguageServerInstance})(conn::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::LanguageServer.DocumentHighlightParams)
@ LanguageServer c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\languageserverinstance.jl:251
[7] dispatch_msg(x::JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::JSONRPC.MsgDispatcher, msg::Dict{String, Any})
@ JSONRPC c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\JSONRPC\src\typed.jl:67
[8] run(server::LanguageServerInstance)
@ LanguageServer c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\packages\LanguageServer\src\languageserverinstance.jl:365
[9] top-level scope
@ c:\Users\regan\.vscode\extensions\julialang.language-julia-1.6.3\scripts\languageserver\main.jl:96
Submitting this as a bug report and a cry for help!