Setting up Visual Studio 2022 Intellisense for making a GDExtension

Godot Version

4.4

Question

Howdy, I’m trying to make an extension for the first time and I’m on Windows 10.

I cloned godot-cpp using the template repository, renamed the placeholder strings in the template, and built the project using Scons. I was able to launch the project’s example scene and it printed the expected output of Type: 24.

I want to use Visual Studio 2022 to write my extension code, but I don’t know how to set it up so that Intellisense is aware of godot-cpp files. I found this page explaining how to build a Visual Studio solution using Scons, but it looks like it was meant for editing the actual engine and not for writing an extension through godot-cpp.

I couldn’t find out how to do this myself, so my questions are:

  • Should I be creating a new blank C++ project in Visual Studio, or should I be generating a solution file some other way?
  • How should I set up my folder structure? It looks like godot-cpp wants me to put my class files in /src, but creating a new Visual Studio project within my local godot-cpp repo creates its own folders.
  • After all that, how do I get Intellisense to work?

Thanks!