 HOOK: find-visual-studio-code-invocation os ( -- array )
 
 MEMO: visual-studio-code-invocation ( -- array )
-    \ visual-studio-code-invocation get [
-        find-visual-studio-code-invocation
-        [ { "code" } ] unless*
-    ] unless* ;
+    {
+        [ \ visual-studio-code-invocation get ]
+        [ find-visual-studio-code-invocation ]
+        [ "code" ]
+    } 0|| ;
 
 M: macosx find-visual-studio-code-invocation
     "com.microsoft.VSCode" find-native-bundle [

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? [ drop f ] unless
    ] unless* ;

M: windows find-visual-studio-code-invocation
    { "Microsoft VS Code" } "code.exe" find-in-applications
    [ f ] unless* ;

M: visual-studio-code editor-command ( file line -- command )
    [

! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators.extras combinators.short-circuit editors
generalizations io.files io.pathnames io.standard-paths kernel
make math.parser memoize namespaces sequences system tools.which ;
IN: editors.visual-studio-code

! Command line arguments
