Skip to content

Instantly share code, notes, and snippets.

@foriequal0
Created January 10, 2017 19:47
Show Gist options
  • Save foriequal0/1397c9e35ed4b520630ae38abd0d5db4 to your computer and use it in GitHub Desktop.
Save foriequal0/1397c9e35ed4b520630ae38abd0d5db4 to your computer and use it in GitHub Desktop.
Unity VSCode Launcher
#!/usr/bin/env bash
# Install VSCode, and add to 'PATH'
# Save this script as code_launcher or something other than 'code'
# Goto 'Unity Preference' -> 'External Tools'
# Set 'External Script Editor' as that code_launcher
# Set 'External Script Editor Args' as '$(File);$(Line);$(ProjectPath)' (without quote)
IFS=';' read -ra ARG <<< "$@"
FILE=${ARG[0]}
LINE=${ARG[1]}
PROJ_PATH=${ARG[2]}
if [[ -z "$FILE" ]]; then
code -r "$PROJ_PATH";
else
code -r --goto "$PROJ_PATH" "$FILE:$LINE";
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment