godotengine / godotengine/godot-csharp-visualstudio

IntelliSense stops working with the debugging workaround

Open
#26 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
276
Forks
27
PR merge metrics
No merged PRs in 30d

Description

**If I use this extension, debugging does not work. If I apply the stub project workaround, debugging works but IntelliSense completely stops working for that project. Deleting the StubProj and restarting VS solves that, but then of course debugging does not work.**

Windows 10
Visual Studio 2022
Godot v3.4.2.stable.mono.official [45eaa2daf]
Godot C# extension for Visual Studio v2.0.0
To get the debugging working, I needed to use the stub project workaround here: https://gist.github.com/31/302bab2630ddf8d90ab4aec0d358b538

Initially everything worked fine, including IntelliSense.
Yesterday IntelliSense wasn't working at first, but then all I remember doing was restarting VS and it was working again.
Today it was not working at all, after multiple restarts.

To clarify, IntelliSense works correctly with any other VS project, just not with a Godot project. All the while debugging works fine, the "Play in editor" works fine, Godot types are recognized, there are no apparent errors. It's just the code completion that's missing, regardless of what member or type I use (I start typing the name of a variable I've defined, and nothing. I type "GD." and nothing. You get the idea.)

(Also, I noticed that after closing Visual Studio with the Godot project, devenv.exe keeps running (and the Visual Studio instance with the project name in its title keeps showing up among the background processes in task manager), until I kill it. I'm only noting this here because this also only happens with a Godot project, and only after the workaround is applied. It doesn't happen with any other Visual Studio project. So possibly the Godot extension is causing this.)

**edit:** I've just realized that [some](https://github.com/godotengine/godot-csharp-visualstudio/issues/10#issuecomment-810797963) [people](https://github.com/godotengine/godot-csharp-visualstudio/issues/10#issuecomment-825014936) have mentioned this problem in the comments under #10 already. Apparently only some of us have this problem, I wonder why...

---
reproducing:
create a new Godot project (in a custom location) called Test
create 3D scene
rename root node "Spatial" to "MainScene"
select MainScene and add a new C# script ("MainScene.cs")
verify that in editor settings, Mono external editor is set to Visual Studio
double click on MainScene.cs in Godot does nothing (devenv.exe is not running)
save scene
go to project in file manager
open sln file ("Test.sln") with VS2022
open MainScene.cs
in _Ready() method, start typing "GD.", IntelliSense is working fine
debugging does not work though, so perform steps of godot-3.2.3-VS-extension-workaround.md (via https://gist.github.com/31/302bab2630ddf8d90ab4aec0d358b538 )
(in the process of that workaround, we do need to close VS, it does in fact properly close this time, checked in task manager)
after those steps are done, open MainScene.cs
in _Ready() method, start typing "GD.", IntelliSense is NOT working.
close VS.
devenv.exe is still running
in task manager end task "Microsoft Visual Studio 2022"
open sln file ("Test.sln") with VS2022 again
IntelliSense is still not working
delete StubProj project
close VS
in task manager end task "Microsoft Visual Studio 2022"
delete StubProj folder from the project folder
open sln file ("Test.sln") with VS2022 yet again
IntelliSense IS working again. However, debugging is not.
close VS (VS does now properly close.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.