From 9698d03955878b3c27660eb59e24ccbbae80464e Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 10 Jan 2011 12:57:44 -0600 Subject: [PATCH] adjust check syntax so that it uses a copy of the definitions text as the source of the program this seems to improve the responsiveness of check syntax a fair amount on a fast machine, copying drracket/private/rep.rkt takes .5 seconds, tho. --- collects/drracket/private/syncheck/gui.rkt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index 3a59c5d700..bd057fae31 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -1243,7 +1243,6 @@ If the namespace does not, they are colored the unbound color. (λ () ; =drs= (send the-tab set-breakables old-break-thread old-custodian) (send the-tab enable-evaluation) - (send definitions-text end-edit-sequence) (close-status-line 'drracket:check-syntax:status) ;; do this with some lag ... not great, but should be okay. @@ -1314,9 +1313,18 @@ If the namespace does not, they are colored the unbound color. (set! user-directory (current-directory)) ;; set by set-directory above (set! user-namespace (current-namespace)))]) (send the-tab disable-evaluation) ;; this locks the editor, so must be outside. - (send definitions-text begin-edit-sequence #f) + + (define definitions-text-copy + (new (class text:basic% + ;; overriding get-port-name like this ensures + ;; that the resulting syntax objects are connected + ;; to the actual definitions-text, not this copy + (define/override (get-port-name) + (send definitions-text get-port-name)) + (super-new)))) + (send definitions-text copy-self-to definitions-text-copy) (with-lock/edit-sequence - definitions-text + definitions-text-copy (λ () (send the-tab clear-annotations) (send the-tab reset-offer-kill) @@ -1324,7 +1332,7 @@ If the namespace does not, they are colored the unbound color. (define settings (send definitions-text get-next-settings)) (drracket:eval:expand-program #:gui-modules? #f - (drracket:language:make-text/pos definitions-text 0 (send definitions-text last-position)) + (drracket:language:make-text/pos definitions-text-copy 0 (send definitions-text-copy last-position)) settings (not (is-a? (drracket:language-configuration:language-settings-language settings) drracket:module-language:module-language<%>))