editors.visual-studio-code: Use the application name Electron on Mac instead of calling it through ``open`` util. Similar to how we do Atom editor support.

locals-and-roots
Doug Coleman 2016-03-28 16:56:07 -07:00
parent e7fa8fbc2f
commit 63f2f22573
1 changed files with 12 additions and 7 deletions

View File

@ -20,23 +20,28 @@ MEMO: visual-studio-code-invocation ( -- array )
] unless* ;
M: macosx find-visual-studio-code-invocation
{ "open" "-b" "com.microsoft.VSCode" "--args" } ;
"com.microsoft.VSCode" find-native-bundle [
"Contents/MacOS/Electron" append-path
] [
f
] if* ;
ERROR: can't-find-visual-studio-code ;
M: linux find-visual-studio-code-invocation
"Code" which [
home "VSCode-linux-x64/Code" append-path dup exists? [
can't-find-visual-studio-code
] unless
] unless* 1array ;
home "VSCode-linux-x64/Code" append-path
dup exists? [ drop f ] unless
] unless* ;
M: windows find-visual-studio-code-invocation
{ "Microsoft VS Code" } "code.exe" find-in-applications
[ 1array ] [ can't-find-visual-studio-code ] if* ;
[ f ] unless* ;
M: visual-studio-code editor-command ( file line -- command )
[
visual-studio-code-invocation % "-g" , "-r" ,
visual-studio-code-invocation
[ , ] [ can't-find-visual-studio-code ] if*
"-g" , "-r" ,
number>string ":" glue ,
] { } make ;