VS Code is not Visual Studio. You’re currently using Visual Studio, not VS Code.
As for your issue:
Check if Visual Studio 2022 is set as the default IDE from Edit > Editor Preferences > General > Source Code in the editor
Check if the Visual Studio Integration Tools plugin is enabled from Edit > Plugins
Check if you have the .NET Desktop Development, Desktop Development with C++, and Game Development with C++ workloads (also the Universal Windows Platform Development workload for older VS 2022 versions than the OP’s) by either navigating to Tools > Get Tools and Features inside VS (The modification window will pop up automatically), or by hitting the Modify option on your VS version inside the installer.
Hope these help
Oh one more thing, I invite you to the dark side
Change your theme to a dark one
So I’ve Been struggling with getting visual studio community 2022 to work with unreal engine 5.6 and then I realized there is a option that you have to click that is missing from the documentation “setting up visual studios for unreal engine 5”. In that documentation there is a screenshot showing four options you can select .net multiplatform, .net desktop, and desktop with C++ there is a fourth option called WinUI application development. unreal engine C++ only works for me if that selected even though in the screenshot it shows up as not selected.