godotengine / godot-vscode-plugin

Godot development tools for VSCode
MIT License
1.47k stars 148 forks source link

Breakpoints inside threads are not triggered properly #647

Open ArchLinus opened 2 months ago

ArchLinus commented 2 months ago

Godot version

v4.2.stable.official [46dc27791]

VS Code version

1.88.1

Godot Tools VS Code extension version

2.0.0

System information

Windows 11

Issue description

When placing a breakpoint in code that runs in a thread, the breakpoint will not be triggered properly. More specifically, the game will pause, but there's no indication of hitting a breakpoint in VSCode and the game will just sit frozen. The breakpoint works in the editor but not in VSCode.

Steps to reproduce

  1. Create a new node
  2. Attach the following script:
    
    extends Node

var thread := Thread.new()

func _ready(): thread.start(_thread_worker)

func _thread_worker(): while true: print("Place a breakpoint here")


3. Place down a breakpoint on the print statement.
4. Launch game from VSCode.