godotengine / godot-csharp-visualstudio

Godot C# extension for Visual Studio
MIT License
256 stars 30 forks source link

Latest Update from the submitted PRs #36

Open GeorgeS2019 opened 2 years ago

GeorgeS2019 commented 2 years ago

There have been THREE PRs recently

Please provide the following information

I am interested to know if these PRs work with Godot4 with dotnet6 merged

Intrivus commented 2 years ago

It works bro it is locked to 2022....

Intrivus commented 2 years ago

I compiled the plugin xd

GeorgeS2019 commented 2 years ago

I saw under VS2019 menu extension. The submenu..GoDot and configure...but it crashes..

Share screenshots..please

Intrivus commented 2 years ago

i can send u the compiled plugin? and i fixed the GoDot bug replaced with Godot

GeorgeS2019 commented 2 years ago

Yes..please share ..do u use Google drive to share

Intrivus commented 2 years ago

image The extension: https://www.mediafire.com/file/24ch2tz6u6embbq/GodotAddinVS.vsix/file

Intrivus commented 2 years ago

Btw u should help me by telling the owner of the PR to make some changes i mention in the PR of his/her

Intrivus commented 2 years ago

who are you

Intrivus commented 2 years ago

If this works, i will promote through godot discord

Dont promote me, promote the guy who make these changes

Intrivus commented 2 years ago

@GeorgeS2019 does it work?

GeorgeS2019 commented 2 years ago

@PandoCyclone

I installed the extension to VS2022. I see the Godot submenu under the Extension Top menu

I provide the Godot exe path to the the Godot Configure submenu

Then I launch Godot (Click)

The Godot exe specified during configure started and run the scene file (chosen)

====> However, the editor did not stop at the BREAKPOINT!!

GeorgeS2019 commented 2 years ago

My VS2022 17.4 preview

Not sure if this is related to this bug Extension stopped working on VisualStudio v17.3.0

Intrivus commented 2 years ago

So it worked or not xd? And i think the breakpoint part is a bug from the extension itself

Intrivus commented 2 years ago

btw check this out to be 100% sure https://github.com/jiiks/godot-csharp-visualstudio

GeorgeS2019 commented 2 years ago

Just so we are on the same page.

There is no more Play in Editor button There is no more extra steps we need to do a few months back

Now, we define the godot exe path and Luanch Godot.

Intrivus commented 2 years ago

Just so we are on the same page.

There is no more Play in Editor button There is no more extra steps we need to do a few months back

Now, we define the godot exe path and Luanch Godot.

Yes but there is some problem as i mentioned here https://github.com/godotengine/godot-csharp-visualstudio/pull/32#issuecomment-1232433130 which should make it even better

Intrivus commented 2 years ago

By making icon for the button and make the button replaced with the Debug one or at least in the tool bar

GeorgeS2019 commented 2 years ago

I suggest U do a gif animated showing that it debug and stop at BreakPoints

Intrivus commented 2 years ago

I suggest U do a gif animated showing that it debug and stop at BreakPoints

The breakpoints bug is from the plugin itself not because this PR

GeorgeS2019 commented 2 years ago

Is the breakpoints bug VS2022 version dependence?

If yes, showing that it works now with other version of VS2022 will also help a lot. We need the breakpoints <=== to work

GeorgeS2019 commented 2 years ago

I will be away. Thanks for the effort of sharing. I compile https://github.com/jiiks/godot-csharp-visualstudio

Godot run from VS2022 but NOT breakpoint This version is GoDot and not Godot

Intrivus commented 2 years ago

For me I don't even know what breakpoints are but you can ask everyone or just watch youtube videos they show that breakpoints bug not work and some workaround for that too. Here is a video for example: https://www.youtube.com/watch?v=lOjOb4Lv_ww&list=WL&index=2&t=992s&ab_channel=FinePointCGI

Intrivus commented 2 years ago

I will be away. Thanks for the effort of sharing. I compile https://github.com/jiiks/godot-csharp-visualstudio

Godot run from VS2022 but NOT breakpoint This version is GoDot and not Godot

Try my fix i sent upthere which fix the bug showing GoDot replaced with Godot and other enhance please check this https://github.com/godotengine/godot-csharp-visualstudio/pull/32#issuecomment-1232433130 comment and support for better PR

GeorgeS2019 commented 2 years ago

The old version, a few months back, the breakpoint WORKs BUT extra steps just to make it works

https://www.youtube.com/watch?v=lOjOb4Lv_ww&list=WL&index=2&t=992s&ab_channel=FinePointCGI

YES, this was the old way and I was able to make breakpoint work. ==> BUT it is NOT reliable.

GeorgeS2019 commented 2 years ago

I assume this is @Jiiks 's plan

From @neikeq: Better IDE support by default, less features need to be implemented in Godot IDE extensions. Projects would be runnable by default as they would be executable rather than library C# projects. A Godot extension would only need to add the more fancy features likePlay in Editor.

Summary

Debug targets

GeorgeS2019 commented 2 years ago

Information provided by Neikeq how to get the extension to work with Godot4

Side note, think I've asked this before maybe, do you know of any way to attach a C# debugger to the C# module code in godot on Linux? To be able to set breakpoints in the modules/mono .cs files, run the editor and step through things? I feel like the answer is no, it seems to be possible on Windows with VS but no Linux tool I've tried is capable of the same "mixed mode" debugging magic that MS have.

I don't know about mixed mode, but for C# only I can do this in Rider:

I tried this with VSCode, but I don't remember if it worked:

{
    "name": ".NET Core Launch (console)",
    "type": "coreclr",
    "request": "launch",
    "program": "Path to Godot executable",
    "args": ["--path", "/path/to/godot/project/"],
    "stopAtEntry": false,
    "console": "internalConsole"
}

As for Windows and Visual Studio, you must add the following to your csproj (or a Directory.Build.props):

  <PropertyGroup>
    <StartAction>Program</StartAction>
    <StartProgram>C:\Path\To\Godot.exe</StartProgram>
    <StartArguments>--path C:\Path\To\Godot\Project\</StartArguments>
  </PropertyGroup>
GeorgeS2019 commented 2 years ago

From neikeq: The root of the issue applies to Godot 4 as well. However, there are other challenges as well, like how to implement Play in Editor with the CoreCLR debugger.

Debugging CoreCLR

"To debug this project, configure it to use the 'Managed (CoreCLR)' debugger." when trying to debug multi target framework in .NET Core

Visual Studio managed debugger

How to: Specify Debugger Settings

GeorgeS2019 commented 2 years ago

case ExecutionType.Launch:

var processStartInfo = new ProcessStartInfo(GetGodotExecutablePath())
{
    string workingDir = startInfo.WorkingDirectory;

    Arguments = $"--path {workingDir} --remote-debug {host}:{remoteDebugPort} {godotStartInfo.StartArguments}", // TODO: Doesn't work with 4.0dev. Should be tcp://host:port which doesn't work in 3.2...
    WorkingDirectory = workingDir,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    UseShellExecute = false,
    CreateNoWindow = true
};

case ExecutionType.PlayInEditor:

var godotMessagingClient = GodotPackage.Instance.GodotSolutionEventsListener?.GodotMessagingClient;

// TODO: Read the editor player stdout and stderr somehow

case ExecutionType.Attach:

_attached = true;
StartConnecting(godotStartInfo);
GeorgeS2019 commented 2 years ago
Command line options #### Command line options that can be included in godotStartInfo.[**StartArguments**](https://docs.godotengine.org/en/stable/tutorials/editor/command_line_tutorial.html) #### Debug options #### Standalone tools

Running a specific Scene :

Feature Request: 'Play Scene' from Visual Studio

Debugging a specific Scene

Running/Debugging a specific script

Intrivus commented 2 years ago

Umm, so there is a way to change GoDot to Godot But I need help with how to open a PR

Intrivus commented 2 years ago

I have some suggestions

image

This Launch make it Godot cuz it is Godot not GoDot :) And you can add the Godot icon for the Godot menu and its Launch button And make the launch button save the current scene before launch?

image

You can replace the debug button(the one that have C# text thingy) with your launch button with the Godot Engine icon Edit: I found a workaround for have launch with Godot in tool bar but there is no icon there so adding Godot Engine icon might look great

image

Or place a Godot button next to the live share button cuz it is more efficient

And btw what is the use of the configure button

Intrivus commented 2 years ago

I have some suggestions

image

This Launch make it Godot cuz it is Godot not GoDot :) And you can add the Godot icon for the Godot menu and its Launch button And make the launch button save the current scene before launch?

image

You can replace the debug button(the one that have C# text thingy) with your launch button with the Godot Engine icon Edit: I found a workaround for have launch with Godot in tool bar but there is no icon there so adding Godot Engine icon might look great

image

Or place a Godot button next to the live share button cuz it is more efficient

And btw what is the use of the configure button

Btw this is the suggestions so anyone like it could help

Intrivus commented 2 years ago

@GeorgeS2019 I think you could close this Issue because it is not necessary anymore.

You could go to the latest PR and tell ppl abt ur suggestions