diff --git a/basis/help/lint/lint.factor b/basis/help/lint/lint.factor index cb206d4fa3..e25070126c 100755 --- a/basis/help/lint/lint.factor +++ b/basis/help/lint/lint.factor @@ -15,6 +15,10 @@ TUPLE: help-lint-error < source-file-error ; SYMBOL: +help-lint-failure+ ++help-lint-failure+ +"vocab:ui/tools/error-list/icons/help-lint-error.tiff" +[ lint-failures get values ] define-error-type + M: help-lint-error source-file-error-type drop +help-lint-failure+ ; ( error experiment file line# -- triple ) diff --git a/basis/ui/tools/error-list/error-list.factor b/basis/ui/tools/error-list/error-list.factor index 21557d92f2..23db13533f 100644 --- a/basis/ui/tools/error-list/error-list.factor +++ b/basis/ui/tools/error-list/error-list.factor @@ -2,8 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays sequences sorting assocs colors.constants fry combinators combinators.smart combinators.short-circuit editors make -memoize compiler.errors compiler.units fonts kernel io.pathnames -prettyprint tools.test help.lint stack-checker.errors +memoize compiler.units fonts kernel io.pathnames prettyprint source-files.errors math.parser init math.order models models.arrow models.arrow.smart models.search models.mapping debugger namespaces summary locals ui ui.commands ui.gadgets ui.gadgets.panes @@ -11,29 +10,15 @@ ui.gadgets.tables ui.gadgets.labeled ui.gadgets.tracks ui.gestures ui.operations ui.tools.browser ui.tools.common ui.gadgets.scrollers ui.tools.inspector ui.gadgets.status-bar ui.operations 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 ; IN: ui.tools.error-list -CONSTANT: error-types - { - +compiler-warning+ - +compiler-error+ - +test-failure+ - +help-lint-failure+ - +linkage-error+ - } +CONSTANT: source-file-icon + T{ image-name f "vocab:ui/tools/error-list/icons/source-file.tiff" } -MEMO: error-list-icon ( object -- object ) - "vocab:ui/tools/error-list/icons/" ".tiff" surround ; - -: error-icon ( type -- icon ) - { - { +compiler-error+ [ "compiler-error" ] } - { +compiler-warning+ [ "compiler-warning" ] } - { +test-failure+ [ "unit-test-error" ] } - { +help-lint-failure+ [ "help-lint-error" ] } - { +linkage-error+ [ "linkage-error" ] } - } case error-list-icon ; +MEMO: error-icon ( type -- image-name ) + error-icon-path ; : ( alist -- gadget ) [ { 15 0 } >>gap ] dip @@ -51,9 +36,6 @@ error-toggle source-file-table error-table error-display ; SINGLETON: source-file-renderer -: source-file-icon ( -- image-name ) - "source-file" error-list-icon ; - M: source-file-renderer row-columns drop first2 [ [ source-file-icon ] [ ] [ length number>string ] tri* ] output>array ; @@ -81,8 +63,8 @@ M: source-file-renderer filled-column drop 1 ; [ invoke-primary-operation ] >>action COLOR: dark-gray >>column-line-color 6 >>gap - 10 >>min-rows - 10 >>max-rows + 5 >>min-rows + 5 >>max-rows 60 >>min-cols 60 >>max-cols t >>selection-required? @@ -126,8 +108,8 @@ M: error-renderer column-alignment drop { 0 1 0 0 } ; [ invoke-primary-operation ] >>action COLOR: dark-gray >>column-line-color 6 >>gap - 20 >>min-rows - 20 >>max-rows + 5 >>min-rows + 5 >>max-rows 60 >>min-cols 60 >>max-cols t >>selection-required? @@ -199,11 +181,7 @@ SINGLETON: updater M: updater definitions-changed 2drop - [ - compiler-errors get-global values % - test-failures get-global % - lint-failures get-global values % - ] { } make + all-errors compiler-error-model get-global set-model ; @@ -214,4 +192,4 @@ M: updater definitions-changed : error-list-window ( -- ) compiler-error-model get-global - "Compiler errors" open-status-window ; \ No newline at end of file + "Errors" open-status-window ; \ No newline at end of file diff --git a/core/compiler/errors/errors.factor b/core/compiler/errors/errors.factor index 3064a56fae..00f9860b3a 100644 --- a/core/compiler/errors/errors.factor +++ b/core/compiler/errors/errors.factor @@ -5,8 +5,6 @@ continuations math math.parser accessors definitions source-files.errors ; IN: compiler.errors -SYMBOLS: +compiler-error+ +compiler-warning+ +linkage-error+ ; - TUPLE: compiler-error < source-file-error ; M: compiler-error source-file-error-type error>> source-file-error-type ; @@ -15,6 +13,12 @@ SYMBOL: compiler-errors compiler-errors [ H{ } clone ] initialize +SYMBOLS: +compiler-error+ +compiler-warning+ +linkage-error+ ; + ++compiler-error+ "vocab:ui/tools/error-list/icons/compiler-error.tiff" [ compiler-errors get values ] define-error-type ++compiler-warning+ "vocab:ui/tools/error-list/icons/compiler-warning.tiff" [ f ] define-error-type ++linkage-error+ "vocab:ui/tools/error-list/icons/linkage-error.tiff" [ f ] define-error-type + SYMBOL: with-compiler-errors? : errors-of-type ( type -- assoc ) diff --git a/core/source-files/errors/errors.factor b/core/source-files/errors/errors.factor index 251adf4d31..90ef2edcb2 100644 --- a/core/source-files/errors/errors.factor +++ b/core/source-files/errors/errors.factor @@ -1,6 +1,7 @@ ! Copyright (C) 2009 Slava Pestov. ! 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 ; IN: source-files.errors TUPLE: source-file-error error asset file line# ; @@ -27,4 +28,21 @@ GENERIC: source-file-error-type ( error -- type ) [ [ swap file>> = ] [ swap source-file-error-type = ] bi-curry* bi and not - ] 2curry filter-here ; \ No newline at end of file + ] 2curry filter-here ; + +SYMBOL: source-file-error-types + +source-file-error-types [ V{ } clone ] initialize + +: error-types ( -- seq ) source-file-error-types get keys ; + +: define-error-type ( type icon quot -- ) + 2array swap source-file-error-types get set-at ; + +: error-icon-path ( type -- icon ) + source-file-error-types get at first ; + +: all-errors ( -- errors ) + source-file-error-types get + [ second second call( -- seq ) ] map + concat ; \ No newline at end of file