godot-csharp-vscode
godot-csharp-vscode copied to clipboard
Add support for Godot 4.0
- Changes extension version to 0.3.0.
- Updates extension dependencies and add
semver
package. - Add basic Godot version detection.
- Uses the
.mono
directory with Godot 3, and the.godot/mono
directory with Godot 4. - The
Play in Editor
configuration is unsupported in Godot 4. - Generate standard coreclr debug configuration for Godot 4.
- The
-q
argument has been repurposed, now--quit
should be used. - Supersedes https://github.com/godotengine/godot-csharp-vscode/pull/39.
- Closes https://github.com/godotengine/godot-csharp-vscode/issues/38.
Since the extension uses the Mono debugger, for Godot 4 it just generates configuration to use the coreclr debugger (provided by the Omnisharp C# extension), which means it won't use the extension for debugging but at least it provides a convenient way to generate the configuration to debug a Godot game.
The Play in Editor configuration won't be generated for Godot 4 projects since it doesn't work. And by this I mean, as long as the metadata file is read from the correct path (which is different in Godot 3 than in 4), and if the version handshake passes (the GodotTools.IdeMessaging
package likely needs to be updated, I tested with a local build), it builds and launches the game but the debugger won't attach since we are using Mono).
Other features such as the completion provider seem to work fine so until https://github.com/godotengine/godot-csharp-visualstudio/issues/18 is implemented, this would allow users to keep getting autocompletion from the extension.
What is the status on this PR? Would be nice to get completions out of the box. Found a simple workaround though. I just copied the .godot/mono/metadata
directory to .mono/metadata
.
neikeq hasn't appeared for a long time. I suggest someone else merge this PR first.
neikeq hasn't appeared for a long time. I suggest someone else merge this PR first.
I quickly checked the contributors and didn't find the second one who has permission to review.
I'm wonder if there is anyone else from Godot maintaining this repo...
This PR needs to be tested and reviewed before it can be merged. Anyone can review PRs, not just Godot maintainers, and it's appreciated.
I'm wonder if there is anyone else from Godot maintaining this repo...
I'm a maintainer, let me explain the current situation with this repo.
With Godot 4.0, this extension is not as useful as it was in 3.x, because now you can use the debugger from the Microsoft C# extension. This currently requires manually setting up the debugging configuration, but it's documented.
Other features, such as autocompletion for scene node paths is something we'd like to provide as a NuGet package so it can be used everywhere instead of having to be implemented for each IDE (see https://github.com/godotengine/godot-csharp-visualstudio/issues/18).
So as a result, adding support for 4.0 does not have a big priority.
I have tested the supplied approach using CoreCLR
and can verify it does work (But does require the official visual studio code release as well as an extension see: https://chickensoft.games/docs/setup/#-vscode-extensions). I think we should expand the documented linked in with:
but it's documented.
Not only is the documentation a bit short but it relies on external information linked in through a github issue. We should include a minimal working example that users of VSCode can add to launch.json
and tasks.json
.
Furthermore, the README and description of this package detail that at least 3.5 needs to be used but the limitation that it does not work for 4.0 and above is mentioned nowhere.
Looking on how to debug C# in Godot easily lands you on this repository. I have personally wasted some hours trying to get this extension to work.
The CoreCLR
solution is also included in several Godot templates such as the prominent: https://github.com/chickensoft-games/GodotGame
In short I think the following are in order, aren't to much work and have clear and large community benefits:
- Update the documentation to be free from external URLs including details about the CoreCLR requirements.
- Either update this extension to support Godot 4 directly or at least make very explicitly clear with large warnings that it will not work for Godot 4.
The following we could do to go the extra mile and make Godot even more awesome:
- Document that for
CoreCLR
the work the binary in/opt/godot/bin/godot.linuxbsd.editor.x86_64.mono
needs to be used and that using/usr/bin/godot-mono
won't work. (This issue might be specific to Arch Linux, verification required). - Document that the
ms-dotnettools.csharp
extension required forCoreCLR
is only available, and will only work in the official Visual Studio Code release.
I'd be more then happy to work on all of this but am new to Godot so some pointers to repo's and potential CLA's I need to sign or other contributor documentation would be appreciated.
I want to leave on the note that I think it is really important to ensure even old documentation stays at least accurate so that it does not leave newcomers frustrated and looking elsewhere.
Is there any way I can implement this PR right now? I would love to have autocomplete in Godot 4, how do I use this modified version of the extension? It looks like I can't just download the branch and add it to my vscode extensions folder