Add fatal? flag to error types; non-fatal errors are hidden by default in error list, not shown in summary
parent
99a120a146
commit
f80c89f128
|
@ -44,6 +44,7 @@ T{ error-type
|
|||
{ icon "vocab:ui/tools/error-list/icons/linkage-error.tiff" }
|
||||
{ quot [ +linkage-error+ errors-of-type values ] }
|
||||
{ forget-quot [ compiler-errors get delete-at ] }
|
||||
{ fatal? f }
|
||||
} define-error-type
|
||||
|
||||
: <compiler-error> ( error word -- compiler-error )
|
||||
|
|
|
@ -26,7 +26,7 @@ MEMO: error-icon ( type -- image-name )
|
|||
|
||||
: <error-toggle> ( -- model gadget )
|
||||
#! Linkage errors are not shown by default.
|
||||
error-types get keys [ dup +linkage-error+ eq? not <model> ] { } map>assoc
|
||||
error-types get [ fatal?>> <model> ] assoc-map
|
||||
[ [ [ error-icon ] dip ] assoc-map <checkboxes> ]
|
||||
[ <mapping> ] bi ;
|
||||
|
||||
|
|
|
@ -358,9 +358,8 @@ interactor "completion" f {
|
|||
} define-command-map
|
||||
|
||||
: ui-error-summary ( -- )
|
||||
all-errors [
|
||||
[ error-type ] map prune
|
||||
[ error-icon-path 1array \ $image prefix " " 2array ] { } map-as
|
||||
error-counts keys [
|
||||
[ icon>> 1array \ $image prefix " " 2array ] { } map-as
|
||||
{ "Press " { $command tool "common" show-error-list } " to view errors." }
|
||||
append print-element nl
|
||||
] unless-empty ;
|
||||
|
|
|
@ -12,7 +12,7 @@ TUPLE: source-file-error error asset file line# ;
|
|||
: group-by-source-file ( errors -- assoc )
|
||||
H{ } clone [ [ push-at ] curry [ dup file>> ] prepose each ] keep ;
|
||||
|
||||
TUPLE: error-type type word plural icon quot forget-quot ;
|
||||
TUPLE: error-type type word plural icon quot forget-quot { fatal? initial: t } ;
|
||||
|
||||
GENERIC: error-type ( error -- type )
|
||||
|
||||
|
@ -34,12 +34,12 @@ error-types [ V{ } clone ] initialize
|
|||
error-types get at icon>> ;
|
||||
|
||||
: error-counts ( -- alist )
|
||||
error-types get [ nip dup quot>> call( -- seq ) length ] assoc-map ;
|
||||
error-types get
|
||||
[ nip dup quot>> call( -- seq ) length ] assoc-map
|
||||
[ [ fatal?>> ] [ 0 > ] bi* and ] assoc-filter ;
|
||||
|
||||
: error-summary ( -- )
|
||||
error-counts
|
||||
[ nip 0 > ] assoc-filter
|
||||
[
|
||||
error-counts [
|
||||
over
|
||||
[ word>> write ]
|
||||
[ " - show " write number>string write bl ]
|
||||
|
|
Loading…
Reference in New Issue