Godot and VS code

Godot Version

4.2

Question

How to configurate Godot and VS Code to work properly?

It is super annoying when I save a script in VSCode, and then Godot is overwriting what I have done with its last version

If you already followed that. Disable it temporarily, close all open scripts in the builtin editor and enable it again.

I just noticed the unwanted behavior.
When clicking in a “nil” declaration error, Godot IDE opens its custom code editor in the “Scripts” panel. but when I want to edit the code, I open VS Code. The problem is when I save my updated code on VS Code and re-run the debugging, Godot saves the code that is in the Scripts panel, overwriting my VS Code coding.
Not clicking the red colored notifications or closing everything before re-debugging avoids the wrong behavior.

happy now :smiley:

oh, no. Sorry.
The problem still exists.
Godot is opening the script by itself if finds a “null instance”.
how can I stop this?

I am curious. Why are you using Visual Code?

I use VSCode with GDScript sometimes. It has actual renaming support + generally better ux than Godot’s builtin editor.

Seems to be a known issue

You can try a different script editor, like Zed, which is open-source and has worked for me.

I went to Script tab,
select Debug from the panel that appears.
There I checked Debug With External Editor.

It blocks opening the script in Godots IDE, but it is not pointing at the line with the error in VS Code.
How can I send the marked line as a parameter?

I have many extensions there and git control. Also I need to stay in 1 editor or I will be a forever student (and it sux to be one)