If you are willing to use other IDEs, JetBrains tools support direct integration with WSL.
I use IntelliJ, PyCharm, and CLion on Windows 11 daily, however, I run, debug, and compile code in WSL.
Setting up is extremely easy and the results are excellent. Just keep in mind that only WSL2 is supported.
https://www.jetbrains.com/help/idea/how-to-use-wsl-development-environment-in-product.html