1 ! Copyright (C) 2006, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: continuations definitions generic help.topics threads
4 stack-checker summary io.pathnames io.styles kernel namespaces parser
5 prettyprint quotations tools.crossref tools.annotations editors
6 tools.profiler tools.test tools.time tools.walker vocabs vocabs.loader
7 words sequences classes compiler.errors compiler.units
8 accessors vocabs.parser macros.expander ui ui.tools.browser
9 ui.tools.listener ui.tools.listener.completion ui.tools.profiler
10 ui.tools.inspector ui.tools.traceback ui.commands ui.gadgets.editors
11 ui.gestures ui.operations ui.tools.deploy models help.tips
13 IN: ui.tools.operations
16 [ drop t ] \ inspector H{
20 : com-prettyprint ( obj -- ) . ;
22 [ drop t ] \ com-prettyprint H{
26 : com-push ( obj -- obj ) ;
28 [ drop t ] \ com-push H{
32 : com-unparse ( obj -- ) unparse listener-input ;
34 [ drop t ] \ com-unparse H{ } define-operation
37 [ model? ] \ inspect-model H{
42 : com-input ( obj -- ) string>> listener-input ;
44 [ input? ] \ com-input H{
50 [ restart? ] \ restart H{
57 [ continuation? ] \ traceback-window H{
63 : com-thread-traceback-window ( thread -- )
64 continuation>> dup occupied>>
65 [ value>> traceback-window ]
69 [ thread? ] \ com-thread-traceback-window H{
75 : edit-file ( pathname -- ) edit ;
77 [ pathname? ] \ edit-file H{
78 { +keyboard+ T{ key-down f { C+ } "e" } }
84 [ definition? ] \ edit H{
85 { +keyboard+ T{ key-down f { C+ } "e" } }
90 [ source-file-error? ] \ edit-error H{
96 : com-reload ( error -- )
99 [ compiler-error? ] \ com-reload H{
104 : com-forget ( defspec -- )
105 [ forget ] with-compilation-unit ;
107 [ definition? ] \ com-forget H{ } define-operation
109 [ topic? ] \ com-browse H{
110 { +keyboard+ T{ key-down f { C+ } "h" } }
114 [ word? ] \ usage. H{
115 { +keyboard+ T{ key-down f { C+ } "u" } }
120 { +keyboard+ T{ key-down f { C+ } "f" } }
124 [ word? ] \ watch H{ } define-operation
126 [ word? ] \ breakpoint H{ } define-operation
128 GENERIC: com-stack-effect ( obj -- )
130 M: quotation com-stack-effect infer. ;
132 M: word com-stack-effect 1quotation com-stack-effect ;
134 : com-enter-in ( vocab -- ) vocab-name set-in ;
136 [ vocab? ] \ com-enter-in H{
140 : com-use-vocab ( vocab -- ) vocab-name use+ ;
142 [ vocab-spec? ] \ com-use-vocab H{
147 [ vocab-spec? ] \ run H{
155 [ vocab-spec? ] \ deploy-tool H{ } define-operation
158 [ quotation? ] \ com-stack-effect H{
159 { +keyboard+ T{ key-down f { C+ } "i" } }
163 [ quotation? ] \ walk H{
164 { +keyboard+ T{ key-down f { C+ } "w" } }
168 [ quotation? ] \ time H{
169 { +keyboard+ T{ key-down f { C+ } "t" } }
173 [ quotation? ] \ com-profile H{
174 { +keyboard+ T{ key-down f { C+ } "o" } }
178 : com-expand-macros ( quot -- ) expand-macros . ;
180 [ quotation? ] \ com-expand-macros H{
181 { +keyboard+ T{ key-down f { C+ } "m" } }
185 ! Operations -> commands
188 "These commands operate on the entire contents of the input area."