Julia version 1.9.0 on VSCODE , for loops and other weird output

trying to do simple for loop on julia 1.9.0 (in vscode),

for i in 1:10
    println(i)
end

julia seems to start evaluating endlessly up
what i see on the repl is the following line

#87 for i in 1:10

julia> versioninfo()
Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
  Threads: 4 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4

if i send running from vscode editor via shift-enter the following expression, this is the strange output on terminal REPL

julia>
#87letter=string.(Set(rand(10:20, 5)))
4-element Vector{String}:
 "20"
 "10"
 "18"
 "14"

my VSCODE version

Version: 1.78.2 (user setup)
Commit: b3e4e68a0bc097f0ae7907b217c1119af9e03435
Date: 2023-05-10T14:39:26.248Z
Electron: 22.5.2
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

Extension version: v1.38.2

I have same strange behavior. As a workaround, I switch to the pre-release version of the extension.

1 Like

It does work for me as expected with the shift-enter method.

julia> versioninfo()
Julia Version 1.9.0
Commit 8e63055292 (2023-05-07 11:25 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, tigerlake)
  Threads: 1 on 8 virtual cores
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

Extension version: v1.38.2

I’ve reproduced it by enabling the config option “Execution: Code in REPL”. Disabling it makes it work as expected (but code sent with shift+enter won’t be displayed).

Actually, the problem with the endless evaluation of the for-loop seems to be that only the first line of code blocks is sent to the REPL. The status bar tells “Evaluating…”, but then you can write anything on the REPL and it works as if the loop had never been sent.

Submitted an issue here:

4 Likes

This seems similar, though a bit distinct from Weird behavior with execution on Julia 1.9-beta · Issue #3220 · julia-vscode/julia-vscode · GitHub

I haven’t been having problems on 1.9, but I might still be using the insider build of the extension. Maybe give that a try?

Same here. Doing trivial things in begin would hang indefinitely but works in pre-release.

begin
 x = 3
end