factor/basis/editors/visual-studio-code/visual-studio-code.factor

23 lines
663 B
Factor
Raw Normal View History

! Copyright (C) 2015 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: editors kernel make memoize namespaces system vocabs ;
IN: editors.visual-studio-code
SINGLETON: visual-studio-code
visual-studio-code editor-class set-global
HOOK: find-visual-studio-code-path os ( -- path )
MEMO: visual-studio-code-path ( -- path )
2015-06-01 17:39:30 -04:00
\ visual-studio-code-path get [
find-visual-studio-code-path
[ "code" ] unless*
] unless* ;
M: visual-studio-code editor-command ( file line -- command )
[
2015-06-01 17:39:30 -04:00
visual-studio-code-path , drop ,
] { } make ;
os windows? [ "editors.visual-studio-code.windows" require ] when