Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Godot 4.0 #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raulsntos
Copy link
Member

@raulsntos raulsntos commented Feb 13, 2023

  • 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 Fix extension for 4.0 #39.
  • Closes Only attach works with Godot 4.0 #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 godotengine/godot-csharp-visualstudio#18 is implemented, this would allow users to keep getting autocompletion from the extension.

- 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.
@raulsntos raulsntos requested a review from neikeq February 13, 2023 16:49
@raulsntos raulsntos mentioned this pull request Feb 13, 2023
@jsbeckr
Copy link

jsbeckr commented Jun 20, 2023

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.

@magian1127
Copy link

neikeq hasn't appeared for a long time. I suggest someone else merge this PR first.

@NachtgeistW
Copy link

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...

@raulsntos
Copy link
Member Author

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 godotengine/godot-csharp-visualstudio#18).

So as a result, adding support for 4.0 does not have a big priority.

@Dantali0n
Copy link
Contributor

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:

  1. Update the documentation to be free from external URLs including details about the CoreCLR requirements.
  2. 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:

  1. 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).
  2. Document that the ms-dotnettools.csharp extension required for CoreCLR 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.

@IsaacGHoward
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only attach works with Godot 4.0
6 participants