This is a follow-on from the @foks selected answer, and is just as much a note for future me as anything.
By using /home/<user>/<projectname> the project is entirely in the VM. You can access the files from Windows at \\wsl$\{your-vm-name} but I'm guessing that will be fairly slow, especially when indexing. I think VS Code has an alternative way to connect that should be faster (maybe it can ssh into the VM and not use mounted filesystems at all).
From within the installed VM project area, you can run Windows commands, so finding the Windows directory for the current directory can be done by issuing:
explorer.exe .
For me, this brings up Explorer with \\wsl$\Ubuntu-18.04\home\adminuser displayed.
A downside seems to be that files changed by the application within the VM do not have events fired back to Windows. So you could run composer update and your VS Code or PHPStorm will not see the vendor directory updates without reloading the directories, and then there is a slow indexing to deal with again. For example, I can touch xxx in the VM, and the Explorer window showing that directory does not see the xxx file until I F5 refresh.
I am personally uncomfortable keeping all my work files inside the VM filesystem - just seems risky for something that is potentially very ethemeral. However, for speed, it is really zippy.
Update: from /home/<user>/<projectname> you can use the command:
code .
and up pops VS Code connected to that application work area as a remote connection. Connecting like that, it sets up watchers on the filesystem, so it does instantly see any file changes. Of course, you are not out of the woods yet, and some work is needed to make sure VS Code uses the correct version of PHP to do its syntax checking. That will be the PHP CLI version running in sail and not the version running in the Ubuntu VM (yes, it's VM turtles all the way down). I think a shell script in your project to wrap vendor/bin/sail php and telling VS Code to run that for all syntax checking, is to way to go.
I'm not sure what the equivalent for PHP Storm is.
I think you can have fast run-time access to files, so the app runs quickly. Or you have fast development access to files, so they are indexed quickly in your editor (if you have to access files via a shared filesystem). But it seems you cannot have both with WSL2. I hope I'm wrong, and there is a way around this.