Error list tool work in progress
parent
2adee07a29
commit
07f585a81d
|
@ -4,6 +4,8 @@ USING: accessors kernel prettyprint io debugger
|
|||
sequences assocs stack-checker.errors summary effects ;
|
||||
IN: stack-checker.errors.prettyprint
|
||||
|
||||
M: inference-error summary error>> summary ;
|
||||
|
||||
M: inference-error error-help error>> error-help ;
|
||||
|
||||
M: inference-error error.
|
||||
|
|
|
@ -46,7 +46,7 @@ SLOT: model
|
|||
|
||||
: show-links-popup ( browser-gadget quot title -- )
|
||||
[ dup model>> ] 2dip <links-popup>
|
||||
[ hand-loc get { 0 0 } <rect> show-glass ] [ request-focus ] bi ;
|
||||
[ hand-loc get { 0 0 } <rect> show-glass ] [ request-focus ] bi ; inline
|
||||
|
||||
: com-show-outgoing-links ( browser-gadget -- )
|
||||
[ uses ] "Outgoing links" show-links-popup ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays sorting assocs colors.constants combinators
|
||||
combinators.smart compiler.errors compiler.units fonts kernel
|
||||
USING: accessors arrays sequences sorting assocs colors.constants combinators
|
||||
combinators.smart compiler.errors compiler.units fonts kernel io.pathnames
|
||||
math.parser math.order models models.arrow namespaces summary ui
|
||||
ui.commands ui.gadgets ui.gadgets.tables ui.gadgets.tracks
|
||||
ui.gestures ui.operations ui.tools.browser ui.tools.common
|
||||
|
@ -10,6 +10,29 @@ IN: ui.tools.compiler-errors
|
|||
|
||||
TUPLE: error-list-gadget < tool table ;
|
||||
|
||||
SINGLETON: source-file-renderer
|
||||
|
||||
M: source-file-renderer row-columns
|
||||
drop [ first2 length number>string 2array ] [ { "All" "" } ] if* ;
|
||||
|
||||
M: source-file-renderer row-value
|
||||
drop first <pathname> ;
|
||||
|
||||
M: source-file-renderer column-titles
|
||||
drop { "File" "Errors" } ;
|
||||
|
||||
: <source-file-table> ( model -- table )
|
||||
[ group-by-source-file >alist sort-keys f prefix ] <arrow>
|
||||
source-file-renderer <table>
|
||||
[ invoke-primary-operation ] >>action
|
||||
COLOR: dark-gray >>column-line-color
|
||||
{ 1 f } >>column-widths
|
||||
6 >>gap
|
||||
30 >>min-rows
|
||||
30 >>max-rows
|
||||
80 >>min-cols
|
||||
80 >>max-cols ;
|
||||
|
||||
SINGLETON: error-renderer
|
||||
|
||||
M: error-renderer row-columns
|
||||
|
@ -32,7 +55,6 @@ M: error-renderer column-titles
|
|||
[ [ [ [ file>> ] [ line#>> ] bi 2array ] compare ] sort ] <arrow>
|
||||
error-renderer <table>
|
||||
[ invoke-primary-operation ] >>action
|
||||
monospace-font >>font
|
||||
COLOR: dark-gray >>column-line-color
|
||||
6 >>gap
|
||||
30 >>min-rows
|
||||
|
@ -41,10 +63,10 @@ M: error-renderer column-titles
|
|||
80 >>max-cols ;
|
||||
|
||||
: <error-list-gadget> ( model -- gadget )
|
||||
[ values ] <arrow> vertical error-list-gadget new-track
|
||||
vertical error-list-gadget new-track
|
||||
{ 3 3 } >>gap
|
||||
swap <error-table> >>table
|
||||
dup table>> <scroller> 1 track-add ;
|
||||
swap <source-file-table> >>table
|
||||
dup table>> <scroller> 1/2 track-add ;
|
||||
|
||||
M: error-list-gadget focusable-child*
|
||||
table>> ;
|
||||
|
@ -72,6 +94,6 @@ M: updater definitions-changed
|
|||
updater remove-definition-observer
|
||||
updater add-definition-observer
|
||||
|
||||
: error-list-window ( obj -- )
|
||||
: error-list-window ( -- )
|
||||
compiler-error-model get-global <error-list-gadget>
|
||||
"Compiler errors" open-window ;
|
Loading…
Reference in New Issue