tools.errors.model: remove in favor of ui.tools.error-list.

factor-shell
John Benediktsson 2017-10-25 12:42:33 -07:00
parent af254f7f0f
commit 10d5d471fe
5 changed files with 40 additions and 50 deletions

View File

@ -1,8 +1,8 @@
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: assocs debugger io kernel sequences source-files.errors USING: accessors assocs command-line compiler.errors debugger
summary accessors continuations make math.parser io.styles namespaces io kernel namespaces sequences source-files.errors
compiler.errors prettyprint source-files.errors.debugger command-line ; source-files.errors.debugger summary ;
IN: tools.errors IN: tools.errors
! Tools for source-files.errors. Used by tools.tests and others ! Tools for source-files.errors. Used by tools.tests and others

View File

@ -1 +0,0 @@
Slava Pestov

View File

@ -1,18 +0,0 @@
! Copyright (C) 2009, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: models source-files.errors namespaces models.delay init
kernel calendar ;
IN: tools.errors.model
SYMBOLS: (error-list-model) error-list-model ;
SINGLETON: updater
M: updater errors-changed
drop f (error-list-model) get-global set-model ;
[
f <model> (error-list-model) set-global
(error-list-model) get-global 100 milliseconds <delay> error-list-model set-global
updater add-error-observer
] "tools.errors.model" add-startup-hook

View File

@ -1,17 +1,17 @@
! Copyright (C) 2009, 2010 Slava Pestov. ! Copyright (C) 2009, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays sequences sorting assocs colors.constants fry USING: accessors arrays assocs calendar colors.constants
combinators combinators.smart combinators.short-circuit editors make combinators combinators.smart compiler.errors debugger editors
memoize compiler.units fonts kernel io.pathnames prettyprint fry init io.pathnames kernel locals math.parser memoize models
source-files.errors source-files.errors.debugger math.parser init math.order models.arrow models.arrow.smart models.delay models.mapping
models models.arrow models.arrow.smart models.search models.mapping debugger models.search namespaces prettyprint sequences sorting
namespaces summary locals ui ui.commands ui.gadgets ui.gadgets.panes source-files.errors source-files.errors.debugger summary ui
ui.gadgets.tables ui.gadgets.labeled ui.gadgets.tracks ui.gestures ui.commands ui.gadgets ui.gadgets.buttons ui.gadgets.labeled
ui.operations ui.tools.browser ui.tools.common ui.gadgets.scrollers ui.gadgets.labels ui.gadgets.packs ui.gadgets.panes
ui.tools.inspector ui.gadgets.buttons ui.gadgets.borders ui.gadgets.labels ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.tables
ui.gadgets.packs ui.theme ui.gadgets.toolbar ui.gadgets.status-bar ui.gadgets.toolbar ui.gadgets.tracks ui.gestures ui.images
ui.baseline-alignment ui.images ui.operations ui.theme ui.tools.browser ui.tools.common
compiler.errors tools.errors tools.errors.model ; ui.tools.inspector ;
IN: ui.tools.error-list IN: ui.tools.error-list
CONSTANT: source-file-icon CONSTANT: source-file-icon
@ -156,7 +156,7 @@ error-display "toolbar" f {
[ swap '[ error-type _ at ] filter ] <smart-arrow> ; [ swap '[ error-type _ at ] filter ] <smart-arrow> ;
:: <error-list-gadget> ( model -- gadget ) :: <error-list-gadget> ( model -- gadget )
vertical \ error-list-gadget new-track vertical error-list-gadget new-track
<error-toggle> [ >>error-toggle ] [ >>visible-errors ] bi* <error-toggle> [ >>error-toggle ] [ >>visible-errors ] bi*
dup visible-errors>> model <error-model> >>model dup visible-errors>> model <error-model> >>model
f <model> >>source-file f <model> >>source-file
@ -178,6 +178,13 @@ error-display "toolbar" f {
M: error-list-gadget focusable-child* M: error-list-gadget focusable-child*
source-file-table>> ; source-file-table>> ;
SYMBOLS: error-list-model ;
SINGLETON: error-list-updater
M: error-list-updater errors-changed
drop f error-list-model get-global model>> set-model ;
: error-list-help ( -- ) "ui.tools.error-list" com-browse ; : error-list-help ( -- ) "ui.tools.error-list" com-browse ;
\ error-list-help H{ { +nullary+ t } } define-command \ error-list-help H{ { +nullary+ t } } define-command
@ -186,14 +193,17 @@ M: error-list-gadget focusable-child*
{ T{ key-down f f "F1" } error-list-help } { T{ key-down f f "F1" } error-list-help }
} define-command-map } define-command-map
MEMO: get-error-list-gadget ( -- gadget ) : error-list-window ( -- )
error-list-model get-global [ drop all-errors ] <arrow> error-list-model get-global [ drop all-errors ] <arrow>
<error-list-gadget> ; <error-list-gadget> "Errors" open-status-window ;
[ \ get-error-list-gadget reset-memoized ] "ui.tools.error-list" add-startup-hook
: show-error-list ( -- ) : show-error-list ( -- )
[ get-error-list-gadget eq? ] find-window [ error-list-gadget? ] find-window
[ raise-window ] [ get-error-list-gadget "Errors" open-status-window ] if* ; [ raise-window ] [ error-list-window ] if* ;
\ show-error-list H{ { +nullary+ t } } define-command \ show-error-list H{ { +nullary+ t } } define-command
[
f <model> 100 milliseconds <delay> error-list-model set-global
error-list-updater add-error-observer
] "ui.tools.error-list" add-startup-hook

View File

@ -7,15 +7,14 @@ documents.elements fonts fry hashtables help help.markup
help.tips io io.styles kernel lexer listener literals locals help.tips io io.styles kernel lexer listener literals locals
math math.vectors models models.arrow models.delay namespaces math math.vectors models models.arrow models.delay namespaces
parser prettyprint sequences source-files.errors strings system parser prettyprint sequences source-files.errors strings system
threads tools.errors.model ui ui.commands ui.gadgets threads ui ui.commands ui.gadgets ui.gadgets.editors
ui.gadgets.editors ui.gadgets.glass ui.gadgets.labeled ui.gadgets.glass ui.gadgets.labeled ui.gadgets.panes
ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.scrollers ui.gadgets.status-bar ui.gadgets.toolbar
ui.gadgets.toolbar ui.gadgets.tracks ui.gestures ui.operations ui.gadgets.tracks ui.gestures ui.operations ui.pens.solid
ui.pens.solid ui.theme ui.tools.browser ui.tools.common ui.theme ui.tools.browser ui.tools.common ui.tools.debugger
ui.tools.debugger ui.tools.error-list ui.tools.error-list ui.tools.listener.completion
ui.tools.listener.completion ui.tools.listener.history ui.tools.listener.history ui.tools.listener.popups vocabs
ui.tools.listener.popups vocabs vocabs.loader vocabs.parser vocabs.loader vocabs.parser vocabs.refresh words ;
vocabs.refresh words ;
IN: ui.tools.listener IN: ui.tools.listener
TUPLE: interactor < source-editor TUPLE: interactor < source-editor