]> gitweb.factorcode.org Git - factor.git/commitdiff
editors.visual-studio-code-insiders: Add a separate vocabulary for insiders builds.
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 3 Nov 2020 20:57:54 +0000 (14:57 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 3 Nov 2020 20:57:54 +0000 (14:57 -0600)
basis/editors/visual-studio-code-insiders/authors.txt [new file with mode: 0644]
basis/editors/visual-studio-code-insiders/visual-studio-code-insiders.factor [new file with mode: 0644]
basis/editors/visual-studio-code/visual-studio-code.factor

diff --git a/basis/editors/visual-studio-code-insiders/authors.txt b/basis/editors/visual-studio-code-insiders/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/basis/editors/visual-studio-code-insiders/visual-studio-code-insiders.factor b/basis/editors/visual-studio-code-insiders/visual-studio-code-insiders.factor
new file mode 100644 (file)
index 0000000..78e50cf
--- /dev/null
@@ -0,0 +1,6 @@
+! Copyright (C) 2020 Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: editors editors.visual-studio-code namespaces ;
+IN: editors.visual-studio-code-insiders
+
+visual-studio-code-insiders editor-class set-global
index e88181deb6036c8bb197c76035bd9654f6df1a3a..d6958e721d0431e8ac62bf4ff1b6ad319d0fa655 100644 (file)
@@ -8,7 +8,7 @@ IN: editors.visual-studio-code
 ! Command line arguments
 ! https://code.visualstudio.com/docs/editor/command-line
 
-SINGLETON: visual-studio-code
+SINGLETONS: visual-studio-code visual-studio-code-insiders ;
 visual-studio-code editor-class set-global
 
 HOOK: find-visual-studio-code-invocation os ( -- array )
@@ -21,8 +21,10 @@ HOOK: find-visual-studio-code-invocation os ( -- array )
     } 0|| ;
 
 M: macosx find-visual-studio-code-invocation
-    { "com.microsoft.VSCodeInsiders" "com.microsoft.VSCode" }
-    [ find-native-bundle ] map-find drop [
+    editor-class get visual-studio-code-insiders =
+    { "com.microsoft.VSCodeInsiders" }
+    { "com.microsoft.VSCode" }
+    ? [ find-native-bundle ] map-find drop [
         "Contents/MacOS/Electron" append-path
     ] [
         f
@@ -31,24 +33,34 @@ M: macosx find-visual-studio-code-invocation
 ERROR: can't-find-visual-studio-code ;
 
 M: linux find-visual-studio-code-invocation
-    {
-        [ "code-insiders" which ]
-        [ "code" which ]
-        [ "Code" which ]
-        [ home "VSCode-linux-x64/Code" append-path ]
-        [ "/usr/share/code/code" ]
-    } [ dup exists? [ drop f ] unless ] map-compose 0|| ;
+    editor-class get visual-studio-code-insiders = [
+        "code-insiders" which
+    ] [
+        {
+            [ "code" which ]
+            [ "Code" which ]
+            [ home "VSCode-linux-x64/Code" append-path ]
+            [ "/usr/share/code/code" ]
+        } [ dup exists? [ drop f ] unless ] map-compose 0||
+    ] if ;
 
 M: windows find-visual-studio-code-invocation
-    {
+    editor-class get visual-studio-code-insiders = [
         [ { "Microsoft VS Code Insiders" } "code-insiders.cmd" find-in-applications ]
-        [ "code.cmd" ]
-    } 0|| ;
+    ] [
+        "code.cmd"
+    ] if ;
 
-M: visual-studio-code editor-command
+: visual-studio-code-editor-command ( file line -- seq )
     [
         visual-studio-code-invocation
         [ , ] [ can't-find-visual-studio-code ] if*
         "-g" , "-r" ,
         number>string ":" glue ,
     ] { } make ;
+
+M: visual-studio-code editor-command
+    visual-studio-code-editor-command ;
+
+M: visual-studio-code-insiders editor-command
+    visual-studio-code-editor-command ;
\ No newline at end of file