Type code
Visual Studio Code icon to appear
To conform with Unity launchers, many apps add a desktop entry into $HOME/.local/share/applications such as visual-studio-code.desktop:
[Desktop Entry]
Version=1.0
Type=Application
Name=Visual Studio Code
Icon=/usr/share/code/resources/app/resources/linux/code.png
Exec=/usr/bin/code
Comment=Visual Studio focused on modern web and cloud
Categories=Development;IDE;
Terminal=false
When installed through Ubuntu Make, this file is created although the Exec entry is wrong. When installed through the .deb downloaded from https://code.visualstudio.com, the file is not even created.
Attached is a working example of a correct entry appearing properly in the Unity Scope search:

/usr/share/applications/visual-studio-code.desktop is installed with the deb, I've found it takes unity some time to pick it up sometimes. Can you try restarting the PC or unity (alt+f2, type "unity", enter).
Unity won't update right away if you put it in /usr/share/... but it will if it's put in the users home version of that: $HOME/.local/share/application/. Is there a reason for not placing it there?
The main reason it's there is because Chrome and Atom put it there. ~/.local/share/application/ all seem to be generated on my PC, are you sure you're meant to mess in that dir?
โฏ ls ~/.local/share/applications/
chrome-apdfllckaahabafndbhieahigkjlhalf-Default.desktop
chrome-eempgbpnkjnacmilmobpbhbfpdjdcpgd-Default.desktop
chrome-fahmaaghhglfmonjliepjlchgpgfmobi-Default.desktop
code_-_alpha.desktop
mimeapps.list
Gnome says put it in /usr/share for all users and ~/.local/share for the single user.
Place this file in the /usr/share/applications directory so that it is accessible by everyone, or in ~/.local/share/applications if you only wish to make it accessible to a single user. Which is used should depend on whether your application is installed systemwide or into a user's home directory. GNOME monitors these directories for changes, so simply copying the file to the right location is enough to register it with the desktop.
Source: https://developer.gnome.org/integration-guide/stable/desktop-files.html.en
Seems like it's in the right place and it's actually an issue with gnome not watching correctly?
I'll uninstall and reinstall it to test.
Again, this is just the latest version downloaded, but here's the result:
m3talsmith@darkness-falling:~$ sudo dpkg -i ~/Downloads/vscode-amd64.deb
(Reading database ... 226542 files and directories currently installed.)
Preparing to unpack .../Downloads/vscode-amd64.deb ...
update-alternatives: warning: alternative /usr/bin/code (part of link group editor) doesn't exist; removing from list of alternatives
Unpacking visual-studio-code (1.1.1-1463146452) over (1.1.1-1463146452) ...
Setting up visual-studio-code (1.1.1-1463146452) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
m3talsmith@darkness-falling:~$ ll /usr/share/applications/
total 728
drwxr-xr-x 2 root root 12288 May 17 12:13 ./
drwxr-xr-x 303 root root 12288 May 17 12:12 ../
-rw-r--r-- 1 root root 384 Mar 2 04:40 activity-log-manager.desktop
-rw-r--r-- 1 root root 291 Apr 13 20:19 apport-gtk.desktop
-rw-r--r-- 1 root root 125 Dec 16 03:08 apturl.desktop
-rw-r--r-- 1 root root 7469 May 17 12:13 bamf-2.index
-rw-r--r-- 1 root root 396 Jan 28 09:59 bluetooth-sendto.desktop
-rw-r--r-- 1 root root 269 Jan 16 16:43 checkbox-converged.desktop
-rw-r--r-- 1 root root 500 Apr 4 08:43 cheese.desktop
-rw-r--r-- 1 root root 12559 Mar 24 14:32 chromium-browser.desktop
-rw-r--r-- 1 root root 587 May 13 06:38 code.desktop
# ...
m3talsmith@darkness-falling:~$ ll ~/.local/share/applications/
total 212
drwx------ 2 m3talsmith m3talsmith 4096 May 17 12:04 ./
drwx------ 17 m3talsmith m3talsmith 4096 May 17 12:09 ../
-rw-rw-r-- 1 m3talsmith m3talsmith 252 May 15 13:28 mimeapps.list
-rw-rw-r-- 1 m3talsmith m3talsmith 708 May 16 22:10 mimeinfo.cache
# ...
code.desktop is the one, forgot it uses the short name.
Right, so it does load it in /usr/share/applications/ for me, but not ~/.local/share/applications/
A restart of Unity does bring it into the scope search, but this isn't the expected way of having a scope.
Maybe the issue here is that it should be installed via desktop-file-install on Unity?
Once the file validates correctly, install it to the default location (probably /usr/share/applications) using the desktop-file-install program. This step may require superuser privileges.
I just tested it, running sudo desktop-file-install /usr/share/applications/code.desktop immediately after install makes it show up in the scope search so to fix this issue I'll add that to the deb post install script.
Thanks for that man! :dancer:
Thanks for reporting, it was a bit of an annoyance for me too :P
@m3talsmith this will land in the May release (early June), thanks again! :fireworks:
Thanks for jumping on it so quickly @Tyriar !
Most helpful comment
I just tested it, running
sudo desktop-file-install /usr/share/applications/code.desktopimmediately after install makes it show up in the scope search so to fix this issue I'll add that to the deb post install script.