Closed
Description
Tested versions
Reproducible in v4.5.beta.custom_build [4e6ac9b]
System information
Godot v4.5.beta (4e6ac9b) - macOS Sequoia (15.5.0) - Multi-window, 2 monitors - OpenGL 3 (Compatibility) - Apple M4 Pro - Apple M4 Pro (14 threads) - 24.00 GiB memory
Issue description
I'm using VS Code and the following exec_flags
:
{project} --goto {file}:{line}:{col}
When an error occurs in the game, the stack frame line number is correct:
However, VS Code opens to the line before the one with the error:
Editors mentioned on the Using an external text editor docs page:
Editor | Lines start at |
---|---|
Geany/Kate | One |
Atom | One |
JetBrains Rider | One |
VS Code | One |
Vim | One |
Emacs | One |
Sublime Text | One |
Visual Studio | Line not passed |
Steps to reproduce
- Create a project with a GDScript that will throw a runtime error, such as attempting to access a member of an object that is guaranteed to be
null
. - In Editor Settings, set up Visual Studio Code as the external code editor.
- Exec Flags should be
{project} --goto {file}:{line}:{col}
. - Use External Editor should be enabled.
- Exec Flags should be
- In the Script tab, check "Debug with External Editor" under the Debug menu.
- Run the scene in the editor so that the error is thrown. VS Code should pop up with the script file, but the cursor will be on the line before the error.
Minimal reproduction project (MRP)
test-vscode-debug-line_2025-06-21_09-25-19.zip
For this MRP, run the scene and press the Enter key to crash it.