Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Resyntax fixes #682

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions drracket-tool-text-lib/drracket/private/syncheck/annotate.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
;; color : syntax[original] str -> void
;; colors the syntax with style-name's style
(define (color stx style-name)
(let ([source (find-source-editor stx)])
(when (and (syntax-position stx)
(syntax-span stx))
(let ([pos (- (syntax-position stx) 1)]
[span (syntax-span stx)])
(color-range source pos (+ pos span) style-name)))))
(define source (find-source-editor stx))
(when (and (syntax-position stx) (syntax-span stx))
(let ([pos (- (syntax-position stx) 1)]
[span (syntax-span stx)])
(color-range source pos (+ pos span) style-name))))
jackfirth marked this conversation as resolved.
Show resolved Hide resolved

;; color-range : text start finish style-name
;; colors a range in the text based on `style-name'
Expand Down Expand Up @@ -55,9 +54,8 @@

;; find-source-editor : stx -> editor or false
(define (find-source-editor stx)
(let ([defs-text (current-annotations)])
(and defs-text
(find-source-editor/defs stx defs-text))))
(define defs-text (current-annotations))
(and defs-text (find-source-editor/defs stx defs-text)))

;; find-source-editor : stx text -> editor or false
(define (find-source-editor/defs stx defs-text)
Expand Down
53 changes: 23 additions & 30 deletions drracket/drracket/drracket.rkt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#lang racket/base
(require racket/gui/base "private/key.rkt" "private/compiled-dir.rkt")
(require racket/gui/base
"private/compiled-dir.rkt"
"private/key.rkt")

(module test racket/base)

Expand All @@ -24,17 +26,15 @@
(flush-output))

(define (run-trace-thread)
(let ([evt (make-log-receiver (current-logger) 'info)])
(void
(thread
(λ ()
(let loop ()
(define vec (sync evt))
(define str (vector-ref vec 1))
(when (regexp-match #rx"^cm: *compil(ing|ed)" str)
(display str)
(newline))
(loop)))))))
(define evt (make-log-receiver (current-logger) 'info))
(void (thread (λ ()
(let loop ()
(define vec (sync evt))
(define str (vector-ref vec 1))
(when (regexp-match #rx"^cm: *compil(ing|ed)" str)
(display str)
(newline))
jackfirth marked this conversation as resolved.
Show resolved Hide resolved
(loop))))))
Comment on lines +30 to +37
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this indentation change, filed sorawee/fmt#72


(cond
[debugging?
Expand Down Expand Up @@ -90,19 +90,12 @@
(define (tool-files id)
(apply
append
(map
(λ (x)
(define proc (get-info/full x))
(if proc
(map (λ (dirs)
(apply build-path
x
(if (list? dirs)
dirs
(list dirs))))
(proc id (λ () '())))
'()))
(find-relevant-directories (list id)))))
(for/list ([x (in-list (find-relevant-directories (list id)))])
(define proc (get-info/full x))
(if proc
(map (λ (dirs) (apply build-path x (if (list? dirs) dirs (list dirs))))
(proc id (λ () '())))
'()))))

(define make-compilation-manager-load/use-compiled-handler
(parameterize ([current-namespace (make-base-empty-namespace)])
Expand Down Expand Up @@ -146,11 +139,11 @@
;; it creates a new custodian and installs it, but the
;; original eventspace was created on the original custodian
;; and this code does not create a new eventspace.
(let ([orig-cust (current-custodian)]
[orig-eventspace (current-eventspace)]
[new-cust (make-custodian)])
(current-custodian new-cust)
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust)))
(define orig-cust (current-custodian))
(define orig-eventspace (current-eventspace))
(define new-cust (make-custodian))
(current-custodian new-cust)
((dynamic-require 'drracket/private/profile-drs 'start-profile) orig-cust))

(dynamic-require 'drracket/private/drracket-normal #f)

Expand Down
50 changes: 25 additions & 25 deletions drracket/drracket/private/syncheck/gui.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,39 @@ If the namespace does not, they are colored the unbound color.

(module+ test (require rackunit))

(require string-constants
racket/unit
racket/match
racket/contract
racket/class
racket/dict
racket/set
racket/runtime-path
racket/place
(require (for-syntax racket/base)
browser/external
data/interval-map
drracket/private/syncheck/annotate
drracket/private/syncheck/colors
drracket/private/syncheck/syncheck-intf
drracket/private/syncheck/traversals
drracket/tool
syntax/toplevel
mrlib/switchable-button
(prefix-in drracket:arrow: drracket/arrow)
(prefix-in fw: framework/framework)
mred
framework
framework/private/logging-timer
framework/private/srcloc-panel
mred
mrlib/switchable-button
net/url
browser/external
(for-syntax racket/base)
(only-in ffi/unsafe register-finalizer)
"../../syncheck-drracket-button.rkt"
racket/class
racket/contract
racket/dict
racket/match
racket/place
racket/runtime-path
racket/set
racket/unit
string-constants
syntax/toplevel
"../../private/eval-helpers-and-pref-init.rkt"
"intf.rkt"
"local-member-names.rkt"
"../../syncheck-drracket-button.rkt"
"../tooltip.rkt"
"blueboxes-gui.rkt"
drracket/private/syncheck/syncheck-intf
drracket/private/syncheck/colors
drracket/private/syncheck/traversals
drracket/private/syncheck/annotate
framework/private/logging-timer)
"intf.rkt"
"local-member-names.rkt"
(prefix-in drracket:arrow: drracket/arrow)
(prefix-in fw: framework/framework)
(only-in ffi/unsafe register-finalizer))
(provide tool@)

(define orig-output-port (current-output-port))
Expand Down
21 changes: 10 additions & 11 deletions drracket/drracket/private/tooltip.rkt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#lang racket/base
(require racket/math
racket/gui
(require framework
racket/class
framework)
racket/gui
racket/math)

;; to bring back types, added "typed/" in front of the
;; racket/* imports, remove these macros and remove the
Expand Down Expand Up @@ -116,14 +116,13 @@
(init-field [frame-to-track #;#;: (Option (Instance Window<%>)) #f])
(: timer (Option (Instance Timer%)))
(define timer
(let ([frame-to-track frame-to-track])
(and frame-to-track
(new timer%
[notify-callback
(λ ()
(unless (send frame-to-track is-shown?)
(show #f)
(send (assert timer) stop)))]))))
(and frame-to-track
(new timer%
[notify-callback
(λ ()
(unless (send frame-to-track is-shown?)
(show #f)
(send (assert timer) stop)))])))


(define/override (on-subwindow-event r evt)
Expand Down
14 changes: 7 additions & 7 deletions drracket/drracket/private/tracing.rkt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#lang racket/base

(require racket/contract
racket/unit
(require drracket/private/drsig
framework
racket/class
racket/contract
racket/gui/base
racket/list
racket/path
racket/port
racket/list
racket/gui/base
racket/unit
string-constants
framework
(prefix-in tr: trace/stacktrace)
drracket/private/drsig)
(prefix-in tr: trace/stacktrace))

(provide tracing@)

Expand Down
Loading