macro-stepper: fix reset/obsolete/shutdown behavior
This commit is contained in:
parent
3dc78a3d1e
commit
a1c7c2b6f9
|
@ -108,7 +108,7 @@
|
||||||
(define drracket-custodian (current-custodian))
|
(define drracket-custodian (current-custodian))
|
||||||
|
|
||||||
(define-local-member-name check-language)
|
(define-local-member-name check-language)
|
||||||
|
|
||||||
(define macro-debugger-up-bitmap (step-icon 'blue (toolbar-icon-height)))
|
(define macro-debugger-up-bitmap (step-icon 'blue (toolbar-icon-height)))
|
||||||
(define macro-debugger-bitmap (macro-stepper-icon (toolbar-icon-height)))
|
(define macro-debugger-bitmap (macro-stepper-icon (toolbar-icon-height)))
|
||||||
|
|
||||||
|
@ -187,18 +187,6 @@
|
||||||
|
|
||||||
;; ----
|
;; ----
|
||||||
|
|
||||||
(define current-stepper-director #f)
|
|
||||||
|
|
||||||
(define/public (obsolete-macro-debugger)
|
|
||||||
(when current-stepper-director
|
|
||||||
(send current-stepper-director add-obsoleted-warning))
|
|
||||||
(when current-stepper-director
|
|
||||||
(send current-stepper-director add-obsoleted-warning)
|
|
||||||
(send current-stepper-director shutdown)
|
|
||||||
(set! current-stepper-director #f)))
|
|
||||||
|
|
||||||
;; --
|
|
||||||
|
|
||||||
(define/public-final (run-macro-stepper)
|
(define/public-final (run-macro-stepper)
|
||||||
|
|
||||||
;; FIXME!!! Lots of this is copied out of drracket/private/syncheck/gui.rkt
|
;; FIXME!!! Lots of this is copied out of drracket/private/syncheck/gui.rkt
|
||||||
|
@ -230,11 +218,11 @@
|
||||||
;; --
|
;; --
|
||||||
|
|
||||||
(define director
|
(define director
|
||||||
(parameterize ((current-eventspace drs-eventspace)
|
(parameterize ((current-eventspace drracket-eventspace)
|
||||||
(current-custodian drs-custodian))
|
(current-custodian drracket-custodian))
|
||||||
(let ([filename (send definitions-text get-filename/untitled-name)])
|
(let ([filename (send definitions-text get-filename/untitled-name)])
|
||||||
(new drracket-macro-stepper-director% (filename filename)))))
|
(new drracket-macro-stepper-director% (filename filename)))))
|
||||||
(set! current-stepper-director director)
|
(send interactions-text set-macro-stepper-director director)
|
||||||
|
|
||||||
(define (the-module-name-resolver . args)
|
(define (the-module-name-resolver . args)
|
||||||
(parameterize ((current-expand-observe void))
|
(parameterize ((current-expand-observe void))
|
||||||
|
@ -379,9 +367,9 @@
|
||||||
(trace* expr)))
|
(trace* expr)))
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
||||||
;; ============================================================
|
;; ============================================================
|
||||||
|
|
||||||
;; Catch modifications => obsolete macro stepper
|
;; Catch modifications => obsolete macro stepper
|
||||||
(define (macro-debugger-definitions-text-mixin %)
|
(define (macro-debugger-definitions-text-mixin %)
|
||||||
(class %
|
(class %
|
||||||
|
@ -415,7 +403,8 @@
|
||||||
(let ([win (get-top-level-window)])
|
(let ([win (get-top-level-window)])
|
||||||
;; should only be #f when win is #f
|
;; should only be #f when win is #f
|
||||||
(when (is-a? win drracket:unit:frame<%>)
|
(when (is-a? win drracket:unit:frame<%>)
|
||||||
(send win obsolete-macro-debugger)))))
|
(send (send win get-interactions-text)
|
||||||
|
obsolete-macro-stepper)))))
|
||||||
|
|
||||||
;; Catch program changes and mark macro stepper obsolete.
|
;; Catch program changes and mark macro stepper obsolete.
|
||||||
(define/augment (on-insert x y)
|
(define/augment (on-insert x y)
|
||||||
|
@ -433,14 +422,23 @@
|
||||||
;; Catch reset => obsolete macro stepper
|
;; Catch reset => obsolete macro stepper
|
||||||
(define (macro-debugger-interactions-text-mixin %)
|
(define (macro-debugger-interactions-text-mixin %)
|
||||||
(class %
|
(class %
|
||||||
(super-new)
|
(define current-stepper-director #f)
|
||||||
(inherit get-top-level-window)
|
(inherit get-top-level-window)
|
||||||
|
(super-new)
|
||||||
|
|
||||||
(define/override (reset-console)
|
(define/override (reset-console)
|
||||||
(super reset-console)
|
(obsolete-macro-stepper)
|
||||||
(let ([win (get-top-level-window)])
|
(when current-stepper-director
|
||||||
(when (is-a? win drracket:unit:frame<%>)
|
(send current-stepper-director shutdown)
|
||||||
(send win obsolete-macro-debugger))))
|
(set! current-stepper-director #f))
|
||||||
|
(super reset-console))
|
||||||
|
|
||||||
|
(define/public (obsolete-macro-stepper)
|
||||||
|
(when current-stepper-director
|
||||||
|
(send current-stepper-director add-obsoleted-warning)))
|
||||||
|
|
||||||
|
(define/public (set-macro-stepper-director director)
|
||||||
|
(set! current-stepper-director director))
|
||||||
))
|
))
|
||||||
|
|
||||||
;; Macro debugger code
|
;; Macro debugger code
|
||||||
|
|
Loading…
Reference in New Issue
Block a user