Just had to deal with this on fresh install of Xubuntu 20.04.5 LTS running XFCE 4.14 and Visual Studio Code 1.74.2, showing the generic gear icon instead of the VS Code icon.
I used Shift and Shiftine's suggestions to poke around and try to locate the icon. I was able to see it when using the GUI to browse, but it wouldn't let me save it/set is as the icon despite numerous attempts.
I had to search for the png file and found it at:
/usr/share/pixmaps/com.visualstudio.code.png
and updated the entry in the code.desktop file like so:
Icon=/usr/share/pixmaps/com.visualstudio.code.png
You can also just right-click the icon, click Edit Launcher, and choose an image file from the dropdown. Navigate to the icon at:
/usr/share/pixmaps/com.visualstudio.code.png
Then click save.
Once I edited that, saved it and closed the icon popped right up like it should. But each time I went to launch it, it would complain that it was trying to execute but wasn't yet set to be executable, and should I launch it anyway. I fixed that by chmod'ing the file based on some reading I was doing here on the VS Code Github, which has supposedly since been resolved:
chmod +x code.desktop
Now the icon looks correct and it launches without error!