VSCode Run Multiple Lines from File in Terminal Broken

EDITED: I was able to narrow down the problem a bit.

I recently updated Julia to v1.9.0-beta4. Previously I was on v1.8.2. I have been using v1.41.1 Pre-Release of the Julia VSCode extension.

After updating Julia versions, I’m getting a strange behavior with Shift+Enter to run selected code in active terminal.
If I have using DataFrames \n using CSV in a file, highlight both lines, and hit Shift+Enter, my terminal looks like this:

julia>

#87using DataFrames

It hangs on that #87using DataFrames line forever. If I click into the terminal and hit enter, it pops down to a new line and allows me to use the REPL. But DataFrames isn’t active

julia>

#87using DataFrames

julia> DataFrames
ERROR: UndefVarError: `DataFrames` not defined

If I run each line separately whether I highlight all or part of the line or just shift enter to run that line, it works. I still get the weird #87 in front of each line, but the code executes correctly.

It also hangs/does not execute anything for any multiline blocks that are sent to the terminal with Shift+Enter even with no highlighting.This is not limited to using statements.

# In the file
begin 
    a = 5+5
end
# Shift+Enter
# In the terminal

#87begin 
julia> 

julia> a
ERROR: UndefVarError: `a` not defined
2 Likes

I had the same problem, and for the moment I just downgraded to 1.8.5.

3 Likes

Afaik the extension is currently not expected to work on 1.9beta.

2 Likes

Filed as Julia 1.9 regression: Running multiple lines from a file in the REPL does not work anymore · Issue #3235 · julia-vscode/julia-vscode · GitHub

1 Like

Anyone knows if this is being worked out? It makes VSCode somewhat hard to use with 1.9, it wouldn’t be nice if 1.9 was launched with VSCode broken for it.

5 Likes

Hello !
I encounter this error after switching from 1.8.5 to 1.9.0.
I did a Pkg.up though.
Maybe the Julia VSCode extension is not already available?
Any solutions?

EDIT : The problem disappears when I switch to the Pre-relaese version of the Julia extension in vscode.

Thanks !

The bug has been fixed already, maybe you only need an update of the extension there, even in the release version.