Better handling of errors without file/line info
parent
2fc05aa44c
commit
fd5ab25a09
|
@ -82,7 +82,7 @@ M: object error-line
|
||||||
error get (:edit) ;
|
error get (:edit) ;
|
||||||
|
|
||||||
: edit-error ( error -- )
|
: edit-error ( error -- )
|
||||||
[ file>> ] [ line#>> ] bi edit-location ;
|
[ file>> ] [ line#>> ] bi 2dup and [ edit-location ] [ 2drop ] if ;
|
||||||
|
|
||||||
: edit-each ( seq -- )
|
: edit-each ( seq -- )
|
||||||
[
|
[
|
||||||
|
|
|
@ -92,7 +92,7 @@ M: object add-breakpoint ;
|
||||||
: (step-into-call-next-method) ( method -- )
|
: (step-into-call-next-method) ( method -- )
|
||||||
next-method-quot (step-into-quot) ;
|
next-method-quot (step-into-quot) ;
|
||||||
|
|
||||||
{
|
<< {
|
||||||
(step-into-quot)
|
(step-into-quot)
|
||||||
(step-into-dip)
|
(step-into-dip)
|
||||||
(step-into-2dip)
|
(step-into-2dip)
|
||||||
|
@ -102,7 +102,7 @@ M: object add-breakpoint ;
|
||||||
(step-into-execute)
|
(step-into-execute)
|
||||||
(step-into-continuation)
|
(step-into-continuation)
|
||||||
(step-into-call-next-method)
|
(step-into-call-next-method)
|
||||||
} [ t "no-compile" set-word-prop ] each
|
} [ t "no-compile" set-word-prop ] each >>
|
||||||
|
|
||||||
! Messages sent to walker thread
|
! Messages sent to walker thread
|
||||||
SYMBOL: step
|
SYMBOL: step
|
||||||
|
|
|
@ -37,14 +37,17 @@ error-toggle source-file-table error-table error-display ;
|
||||||
SINGLETON: source-file-renderer
|
SINGLETON: source-file-renderer
|
||||||
|
|
||||||
M: source-file-renderer row-columns
|
M: source-file-renderer row-columns
|
||||||
drop first2
|
drop first2 [
|
||||||
[ [ source-file-icon ] [ ] [ length number>string ] tri* ] output>array ;
|
[ source-file-icon ]
|
||||||
|
[ "<Listener input>" or ]
|
||||||
|
[ length number>string ] tri*
|
||||||
|
] output>array ;
|
||||||
|
|
||||||
M: source-file-renderer prototype-row
|
M: source-file-renderer prototype-row
|
||||||
drop source-file-icon "" "" 3array ;
|
drop source-file-icon "" "" 3array ;
|
||||||
|
|
||||||
M: source-file-renderer row-value
|
M: source-file-renderer row-value
|
||||||
drop dup [ first <pathname> ] when ;
|
drop dup [ first [ <pathname> ] [ f ] if* ] when ;
|
||||||
|
|
||||||
M: source-file-renderer column-titles
|
M: source-file-renderer column-titles
|
||||||
drop { "" "File" "Errors" } ;
|
drop { "" "File" "Errors" } ;
|
||||||
|
@ -76,7 +79,7 @@ M: error-renderer row-columns
|
||||||
drop [
|
drop [
|
||||||
{
|
{
|
||||||
[ error-type error-icon ]
|
[ error-type error-icon ]
|
||||||
[ line#>> number>string ]
|
[ line#>> [ number>string ] [ "" ] if* ]
|
||||||
[ asset>> unparse-short ]
|
[ asset>> unparse-short ]
|
||||||
[ error>> summary ]
|
[ error>> summary ]
|
||||||
} cleave
|
} cleave
|
||||||
|
@ -96,9 +99,12 @@ M: error-renderer column-alignment drop { 0 1 0 0 } ;
|
||||||
: sort-errors ( seq -- seq' )
|
: sort-errors ( seq -- seq' )
|
||||||
[ [ [ file>> ] [ line#>> ] bi 2array ] compare ] sort ;
|
[ [ [ file>> ] [ line#>> ] bi 2array ] compare ] sort ;
|
||||||
|
|
||||||
|
: file-matches? ( error pathname/f -- ? )
|
||||||
|
[ file>> ] [ dup [ string>> ] when ] bi* = ;
|
||||||
|
|
||||||
: <error-table-model> ( error-list -- model )
|
: <error-table-model> ( error-list -- model )
|
||||||
[ model>> ] [ source-file>> ] bi
|
[ model>> ] [ source-file>> ] bi
|
||||||
[ [ file>> ] [ string>> ] bi* = ] <search>
|
[ file-matches? ] <search>
|
||||||
[ sort-errors ] <arrow> ;
|
[ sort-errors ] <arrow> ;
|
||||||
|
|
||||||
:: <error-table> ( error-list -- table )
|
:: <error-table> ( error-list -- table )
|
||||||
|
|
|
@ -82,6 +82,8 @@ M: engine-word stack-effect
|
||||||
effect boa
|
effect boa
|
||||||
] [ 2drop f ] if ;
|
] [ 2drop f ] if ;
|
||||||
|
|
||||||
|
M: engine-word where "tuple-dispatch-generic" word-prop where ;
|
||||||
|
|
||||||
M: engine-word crossref? "forgotten" word-prop not ;
|
M: engine-word crossref? "forgotten" word-prop not ;
|
||||||
|
|
||||||
M: engine-word irrelevant? drop t ;
|
M: engine-word irrelevant? drop t ;
|
||||||
|
|
|
@ -20,10 +20,7 @@ GENERIC: error-type ( error -- type )
|
||||||
new
|
new
|
||||||
swap
|
swap
|
||||||
[ >>asset ]
|
[ >>asset ]
|
||||||
[
|
[ where [ first2 [ >>file ] [ >>line# ] bi* ] when* ] bi
|
||||||
where [ first2 ] [ "<unknown file>" 0 ] if*
|
|
||||||
[ >>file ] [ >>line# ] bi*
|
|
||||||
] bi
|
|
||||||
swap >>error ; inline
|
swap >>error ; inline
|
||||||
|
|
||||||
: delete-file-errors ( seq file type -- )
|
: delete-file-errors ( seq file type -- )
|
||||||
|
@ -42,8 +39,11 @@ error-types [ V{ } clone ] initialize
|
||||||
: error-icon-path ( type -- icon )
|
: error-icon-path ( type -- icon )
|
||||||
error-types get at icon>> ;
|
error-types get at icon>> ;
|
||||||
|
|
||||||
|
: error-counts ( -- alist )
|
||||||
|
error-types get [ nip dup quot>> call( -- seq ) length ] assoc-map ;
|
||||||
|
|
||||||
: error-summary ( -- )
|
: error-summary ( -- )
|
||||||
error-types get [ nip dup quot>> call( -- seq ) length ] assoc-map
|
error-counts
|
||||||
[ nip 0 > ] assoc-filter
|
[ nip 0 > ] assoc-filter
|
||||||
[
|
[
|
||||||
over
|
over
|
||||||
|
|
Loading…
Reference in New Issue