Godot always opens gdscripts in VSCodium (unwanted) and cannot open C# scripts in VSCodium at all

Godot Version

v4.7.stable.mono.official [5b4e0cb0f]

Question

I have transitioned my desktop and all my godot development away from Windows 10 to Linux Mint 22.3 Cinnamon because Windows 11 was the last straw for me. It’s going well so far except that something has gone wrong with the connection to the external code editor.

For some reason, no matter what I do, I cannot get any C# scripts to open from godot into my external editor which is VSCodium, and I cannot get my gdscripts to open in the internal editor, they always open - entirely correctly I might add - in VSCodium, but of course then they have absolutely no syntax highlighting, they act like regular text files. Once I’ve opened the gdscript I can then navigate to the C# scripts inside VSCodium and they work and the game builds and runs correctly thereafter.

On Windows it behaved the way I assume it is supposed to, which is that C# scripts opened in VSCodium, and gdscripts opened in the internal editor.

When I try to open a C# script, godot throws these errors:

  ERROR: /root/godot/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs:397 - Cannot find code editor: Visual Studio Code or VSCodium
  ERROR: editor/script/script_editor_plugin.cpp:2217 - Couldn't open script in the overridden external text editor

Then when I try to open a gdscript, even if I open the Scripts tab in godot then use File → Open… and manually select a .gd file, it will STILL open in VSCodium.

What’s really weird is that when I open up Editor Settings → Dotnet → Editor, it doesn’t matter if I have the editor set to “Visual Studio Code and VSCodium” or disabled, or what I enter in those fields, this behaviour does not change at all. C# scripts still throw the error as if they are trying to open in VSCodium, and gdscripts still open in VSCodium, even if I have disabled the external code editor entirely.

I’m afraid I can’t retrace all of the steps I took to get to this point, this issue has been plaguing me for a while since I could still open VSCodium manually and it would work for C# so I didn’t feel the need to address it. Now with gdscripts refusing to work I’ve hit a bit of a wall since I can’t easily develop those scripts without the internal editor. I’ve uninstalled and reinstalled VSCodium to no avail.

This is utterly baffling behaviour and I cannot find anyone else having this problem, every person who’s reported the errors above has been on Windows that I can see.

Does anyone have any ideas about what I can do to troubleshoot this? I have spent a lot of time on linux over the years but I’m by no means an expert.

After I moved to Linux (same Mint as you) C# scripts wouldnt open directly from Godot to Jetbrains and nothing I added to Godot’s settings would work.

In the end I created a very small sh script, which just says launch the given file in Jetbrains and added that to Godots external editor setting instead.

Will provide an example after I get home from work.

Thanks that would be a workaround for one half of the problem, but it still leaves me without access to the internal editor for gdscripts.

If there isn’t a proper solution for this I think I should probably make it a bug report.

Also if godot really is incapable of opening C# scripts in the external editor it is very confusing why it would do so for gdscripts.

i also use linux mint 22.3 cinnamon and i have no issues with opening gdscripts in the internal editor, i dont use c# so it is likely a problem with what you set up, so mess around in different settings until you find the issue.

Do you use the mono version of godot or the other version?

I’ve figured out the problem, I actually had the external editor set up for gdscript under Editor Settings → Text Editor → External. I had forgotten that I’d done that and hadn’t found it on this latest attempt to solve the problem.

When I disabled the external editor for dotnet, it actually fell back to the text editor settings, so briefly I did have the external editor working.

Unfortunately I accidentally deleted those settings so now I have now idea how to fix the problem again.

It’s basically the same as this issue: VSCode not opening as external editor

Anyway, that solves my internal script editor issues, so if you still have that shell script that could solve my problems.