editors.visual-studio-code: Support for m$ft's new code editor. Can't

figure out command line parameters yet.
io.files.temp.windows: Make (get-appdata-directory) not private and rename
it to get-appdata-directory.
db4
Doug Coleman 2015-04-30 18:20:16 -07:00
parent a7cd03b45d
commit 74f5eacec7
2 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,22 @@
! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays ascii editors io.directories.search
io.files.temp.windows io.pathnames kernel make math.parser
memoize namespaces sequences ;
IN: editors.visual-studio-code
SINGLETON: visual-studio-code
visual-studio-code editor-class set-global
MEMO: visual-studio-code-path ( -- path )
\ visual-studio-code-path get-global [
get-appdata-directory 1array f
[ file-name >lower "code.exe" = ] find-in-directories
[ "code" ] unless*
] unless* ;
M: visual-studio-code editor-command ( file line -- command )
[
visual-studio-code-path ,
swap , drop
] { } make ;

View File

@ -14,7 +14,9 @@ IN: io.files.temp.windows
swap win32-error=0/f
alien>native-string ;
: (get-appdata-directory) ( -- path )
PRIVATE>
: get-appdata-directory ( -- path )
f
CSIDL_LOCAL_APPDATA CSIDL_FLAG_CREATE bitor
f
@ -23,7 +25,6 @@ IN: io.files.temp.windows
[ SHGetFolderPath ] keep
swap check-ole32-error alien>native-string ;
PRIVATE>
MEMO: (temp-directory) ( -- path )
(get-temp-directory) "factorcode.org\\Factor" append-path dup make-directories ;
@ -31,6 +32,6 @@ MEMO: (temp-directory) ( -- path )
M: windows temp-directory (temp-directory) ;
MEMO: (cache-directory) ( -- path )
(get-appdata-directory) "factorcode.org\\Factor" append-path dup make-directories ;
get-appdata-directory "factorcode.org\\Factor" append-path dup make-directories ;
M: windows cache-directory (cache-directory) ;