I've figured out how to debug gdetension with Visual Studio (or Rider).
1. First you need to compile your engine and your extension with dev_build=yes
2. You'll get dll with "dev" name in it. Provide path to it i your extension file.
3. Create an empty Visual Studio solution. And an empty NMake project.
4. Setup studio to build your code for you with debug button. Type in NMake tab of project properties, in the "build command line" the command: scons dev_build=yes. This way studio will compile project for you.
5. In the Dedugger tab set launch command to "$your_path\godot.windows.editor.dev.x86_64.exe"
6. Set command line arguments with "--path" command that will tell engine to start game immediately. like this: --path "$(SolutionDir)../"
6.a. If you'll provide in argument path to your godot.project engine will start in editor mode. Thats fine if you want to debug editor, but if you'll start game from the editor the c++ debugger wont attach to it. For debugging editor I've created another NMake configuration for it.
6.b. Probably a studio bug, but in order to intell issence to see godot-cpp code it wants its path to be included in "additional include" field of c++ configuration tab which is missing in NMake configuration. you might want to switch to c++ configuration, add additional includes path that lead to godot-cpp source, and then switch back to NMake. Or you can manually edit project file in text editor by adding there something like (in my case):
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='GDExt|x64'">
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)godot-cpp\gdextension;$(SolutionDir)godot-cpp\include;$(SolutionDir)godot-cpp\gen\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
7. That pretty much it. you are ready to go. you can also add godot engine project to your solution if you want. this way you don't need to copy pdb anywhere (it did not work for me anyway)