Visual Studio Code is not natively supported on Android yet. So there is no way to natively run VSCode on Android with your Note 9 and Samsung DeX.
You do however have the following two options available:
- When using "Linux on DeX" then you have the option to run Visual Studio Code natively from the Linux environment on Samsung DeX, although do keep in mind that Linux on DeX is now discontinued starting Android 10.
- Remotely log into a different Linux, Windows or Mac computer and use VSCode on those computer through your phone on Samsung DeX.
Ofcourse the first option is the best. I recommend using Linux on DeX for this. Right now there isn't a native Android version of VSCode :(