In VS Code add a new configuration to launch json.
Open launch.json ctl+shirt+p and type launch.json. From there you can open launch.json.
The revelent section is to add to your launch.json is Python: Sphinx Docs
{
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: Sphinx Docs",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/env/bin/sphinx-build",
"cwd": "${workspaceFolder}/docs",
"args": [
"-E",
"-b",
"html",
"-d",
"_build/doctrees",
".",
"_build/html"
],
"console": "integratedTerminal",
"justMyCode": false
}
]
}-Eto force it to rebuild even if nothing’s changed-bto set bulderhtmlbuilderdpath for the cached environment and doctree files (default: OUTPUTDIR/.doctrees)_build/doctreescached environment.source directory_build/htmloutput directory.
justMyCodesets if debugger steps only through local code or include code in site-packages.
For PyCharm see Step debugging sphinx-build in PyCharm