]> gitweb.factorcode.org Git - factor.git/commitdiff
fixups: integrate with restarts
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Dec 2021 16:31:46 +0000 (10:31 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 30 Dec 2021 16:35:04 +0000 (10:35 -0600)
Right now, a fixup is just a message that says some vocabulary
or word got renamed.

basis/fixups/fixups.factor
basis/ui/tools/debugger/debugger.factor
basis/ui/tools/listener/listener.factor

index 11085dc60ce19f22134ab0598c37675dd6979ef6..f4fa556ce88d647ec09c4a79c5fb8b2b354d8358 100644 (file)
@@ -40,8 +40,8 @@ CONSTANT: word-renames {
         drop { }
     ] [
         swap '[
-            first2 dupd first2 "Fixup: `%s` got renamed to `%s` in %s" sprintf
-            swap drop f
+            first2 dupd first2 "Fixup: %s renamed to %s in Factor %s" sprintf
+            swap drop no-op-action
             _ <restart>
         ] map
     ] if-empty ;
index 1671aca4bc2beb96518093896d55691700242071..7d2a70f8ba7142f329b35a2d4a87f46d65151cfc 100644 (file)
@@ -15,6 +15,10 @@ IN: ui.tools.debugger
 
 TUPLE: debugger < track error restarts restart-hook restart-list continuation ;
 
+! The "Abort" restart is actually an `f` object, so to show a restart
+! with information but do nothing, we define a no-op-action
+SINGLETON: no-op-action
+
 <PRIVATE
 
 SINGLETON: restart-renderer
@@ -24,7 +28,12 @@ M: restart-renderer row-columns
 
 : <restart-list> ( debugger -- gadget )
     dup restarts>> f prefix <model> restart-renderer <table>
-        [ [ \ continue-restart invoke-command ] when* ] >>action
+        [
+            [
+                dup obj>> no-op-action =
+                [ drop ] [ \ continue-restart invoke-command ] if
+            ] when*
+        ] >>action
         swap restart-hook>> >>hook
         t >>selection-required?
         t >>single-click? ; inline
index 98c0a0fae9142e9f5fadaa2698f8c3864fd7942c..3ac1c19c34b4be4e93712f363ef712e69b37272d 100644 (file)
@@ -3,7 +3,7 @@
 USING: accessors arrays assocs calendar combinators
 combinators.short-circuit concurrency.flags
 concurrency.mailboxes continuations destructors documents
-documents.elements fonts hashtables help help.markup help.tips
+documents.elements fixups fonts hashtables help help.markup help.tips
 io io.styles kernel lexer listener literals math math.vectors
 models models.arrow models.delay namespaces parser prettyprint
 sequences source-files.errors splitting strings system threads
@@ -352,7 +352,8 @@ M: object accept-completion-hook 2drop ;
 :: <debugger-popup> ( error continuation interactor -- popup )
     error
     continuation
-    error compute-restarts
+    continuation error compute-fixups
+    error compute-restarts append
     error interactor make-restart-hook-quot
     <debugger> frame-debugger ;