Working on error list change notification
parent
7a33780bc2
commit
cdd372314b
|
@ -1,8 +1,8 @@
|
||||||
IN: ui.tools.error-list
|
IN: ui.tools.error-list
|
||||||
USING: help.markup help.syntax ;
|
USING: help.markup help.syntax ui.tools.common ui.commands ;
|
||||||
|
|
||||||
ARTICLE: "ui.tools.error-list" "UI error list tool"
|
ARTICLE: "ui.tools.error-list" "UI error list tool"
|
||||||
"The error list tool displays messages generated by tools which process source files and definitions."
|
"The error list tool displays messages generated by tools which process source files and definitions. To display the error list, press " { $command tool "common" show-error-list } " in any UI tool window."
|
||||||
$nl
|
$nl
|
||||||
"The " { $vocab-link "source-files.errors" } " vocabulary contains backend code used by this tool."
|
"The " { $vocab-link "source-files.errors" } " vocabulary contains backend code used by this tool."
|
||||||
{ $heading "Message icons" }
|
{ $heading "Message icons" }
|
||||||
|
|
|
@ -4,14 +4,14 @@ USING: accessors arrays sequences sorting assocs colors.constants fry
|
||||||
combinators combinators.smart combinators.short-circuit editors make
|
combinators combinators.smart combinators.short-circuit editors make
|
||||||
memoize compiler.units fonts kernel io.pathnames prettyprint
|
memoize compiler.units fonts kernel io.pathnames prettyprint
|
||||||
source-files.errors math.parser init math.order models models.arrow
|
source-files.errors math.parser init math.order models models.arrow
|
||||||
models.arrow.smart models.search models.mapping debugger namespaces
|
models.arrow.smart models.search models.mapping models.delay debugger namespaces
|
||||||
summary locals ui ui.commands ui.gadgets ui.gadgets.panes
|
summary locals ui ui.commands ui.gadgets ui.gadgets.panes
|
||||||
ui.gadgets.tables ui.gadgets.labeled ui.gadgets.tracks ui.gestures
|
ui.gadgets.tables ui.gadgets.labeled ui.gadgets.tracks ui.gestures
|
||||||
ui.operations ui.tools.browser ui.tools.common ui.gadgets.scrollers
|
ui.operations ui.tools.browser ui.tools.common ui.gadgets.scrollers
|
||||||
ui.tools.inspector ui.gadgets.status-bar ui.operations
|
ui.tools.inspector ui.gadgets.status-bar ui.operations
|
||||||
ui.gadgets.buttons ui.gadgets.borders ui.gadgets.packs
|
ui.gadgets.buttons ui.gadgets.borders ui.gadgets.packs
|
||||||
ui.gadgets.labels ui.baseline-alignment ui.images
|
ui.gadgets.labels ui.baseline-alignment ui.images
|
||||||
compiler.errors ;
|
compiler.errors calendar ;
|
||||||
IN: ui.tools.error-list
|
IN: ui.tools.error-list
|
||||||
|
|
||||||
CONSTANT: source-file-icon
|
CONSTANT: source-file-icon
|
||||||
|
@ -173,26 +173,23 @@ error-list-gadget "toolbar" f {
|
||||||
{ T{ key-down f f "F1" } error-list-help }
|
{ T{ key-down f f "F1" } error-list-help }
|
||||||
} define-command-map
|
} define-command-map
|
||||||
|
|
||||||
SYMBOL: compiler-error-model
|
SYMBOL: error-list-model
|
||||||
|
|
||||||
compiler-error-model [ f <model> ] initialize
|
error-list-model [ f <model> ] initialize
|
||||||
|
|
||||||
SINGLETON: updater
|
SINGLETON: updater
|
||||||
|
|
||||||
M: updater definitions-changed
|
M: updater errors-changed
|
||||||
2drop
|
drop f error-list-model get-global set-model ;
|
||||||
all-errors
|
|
||||||
compiler-error-model get-global
|
|
||||||
set-model ;
|
|
||||||
|
|
||||||
[
|
[ updater add-error-observer ] "ui.tools.error-list" add-init-hook
|
||||||
updater remove-definition-observer
|
|
||||||
updater add-definition-observer
|
: <error-list-model> ( -- model )
|
||||||
] "ui.tools.error-list" add-init-hook
|
error-list-model get-global
|
||||||
|
1/2 seconds <delay> [ drop all-errors ] <arrow> ;
|
||||||
|
|
||||||
: error-list-window ( -- )
|
: error-list-window ( -- )
|
||||||
compiler-error-model get-global <error-list-gadget>
|
<error-list-model> <error-list-gadget> "Errors" open-status-window ;
|
||||||
"Errors" open-status-window ;
|
|
||||||
|
|
||||||
: show-error-list ( -- )
|
: show-error-list ( -- )
|
||||||
[ error-list-gadget? ] find-window
|
[ error-list-gadget? ] find-window
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! 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: accessors assocs kernel math.order sorting sequences definitions
|
USING: accessors assocs kernel math.order sorting sequences definitions
|
||||||
namespaces arrays splitting io math.parser math ;
|
namespaces arrays splitting io math.parser math init ;
|
||||||
IN: source-files.errors
|
IN: source-files.errors
|
||||||
|
|
||||||
TUPLE: source-file-error error asset file line# ;
|
TUPLE: source-file-error error asset file line# ;
|
||||||
|
@ -56,3 +56,15 @@ error-types [ V{ } clone ] initialize
|
||||||
error-types get values
|
error-types get values
|
||||||
[ quot>> call( -- seq ) ] map
|
[ quot>> call( -- seq ) ] map
|
||||||
concat ;
|
concat ;
|
||||||
|
|
||||||
|
GENERIC: errors-changed ( observer -- )
|
||||||
|
|
||||||
|
SYMBOL: error-observers
|
||||||
|
|
||||||
|
[ V{ } clone error-observers set-global ] "source-files.errors" add-init-hook
|
||||||
|
|
||||||
|
: add-error-observer ( observer -- ) error-observers get push ;
|
||||||
|
|
||||||
|
: remove-error-observer ( observer -- ) error-observers get delq ;
|
||||||
|
|
||||||
|
: notify-error-observers ( -- ) error-observers get [ errors-changed ] each ;
|
Loading…
Reference in New Issue