editors.visual-studio-code: msft changed the install directory to

c:\program files (x86). Now we don't need the platform-specific windows
file.
Also, add -r option to reuse existing windows.
db4
Doug Coleman 2016-03-07 13:23:24 -08:00
parent 334cc880ec
commit 253de1dc8e
3 changed files with 12 additions and 19 deletions

View File

@ -1,10 +1,13 @@
! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays editors io.files io.pathnames kernel make
math.parser memoize namespaces sequences system tools.which
vocabs ;
USING: arrays editors 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
! https://code.visualstudio.com/docs/editor/codebasics#_additional-command-line-arguments
SINGLETON: visual-studio-code
visual-studio-code editor-class set-global
@ -17,7 +20,7 @@ MEMO: visual-studio-code-invocation ( -- array )
] unless* ;
M: macosx find-visual-studio-code-invocation
{ "open" "-n" "-b" "com.microsoft.VSCode" "--args" } ;
{ "open" "-n" "-b" "-r" "com.microsoft.VSCode" "--args" } ;
ERROR: can't-find-visual-studio-code ;
@ -28,10 +31,12 @@ M: linux find-visual-studio-code-invocation
] unless
] unless* 1array ;
M: windows find-visual-studio-code-invocation
{ "Microsoft VS Code" } "code.exe" find-in-applications
[ 1array ] [ can't-find-visual-studio-code ] if* ;
M: visual-studio-code editor-command ( file line -- command )
[
visual-studio-code-invocation % "-g" ,
visual-studio-code-invocation % "-g" , "-r" ,
number>string ":" glue ,
] { } make ;
os windows? [ "editors.visual-studio-code.windows" require ] when

View File

@ -1 +0,0 @@
windows

View File

@ -1,11 +0,0 @@
! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays ascii editors.visual-studio-code
io.directories.search io.files.temp.windows io.pathnames kernel
system ;
IN: editors.visual-studio-code.windows
M: windows find-visual-studio-code-invocation
get-appdata-directory f
[ file-name >lower "code.exe" = ] find-in-directories
[ 1array ] [ f ] if* ;