Making separate find-syntax-source-editor file.
svn: r10432
This commit is contained in:
parent
6965dfd86c
commit
d6ee81feba
|
@ -16,6 +16,7 @@ profile todo:
|
|||
scheme/gui/base
|
||||
string-constants
|
||||
framework/private/bday
|
||||
"find-syntax-source-editor.ss"
|
||||
"drsig.ss"
|
||||
"bindings-browser.ss"
|
||||
(for-syntax scheme/base))
|
||||
|
@ -775,7 +776,8 @@ profile todo:
|
|||
[(and frame (is-a? frame frame:editor<%>))
|
||||
(send frame get-editor)]
|
||||
[else #f])]
|
||||
[(is-a? debug-source editor<%>) debug-source])]
|
||||
[(is-a? debug-source editor<%>) debug-source]
|
||||
[else #f])]
|
||||
[rep (and (is-a? frame drscheme:unit:frame%)
|
||||
(send frame get-interactions-text))])
|
||||
(when frame
|
||||
|
|
30
collects/drscheme/private/find-syntax-source-editor.ss
Normal file
30
collects/drscheme/private/find-syntax-source-editor.ss
Normal file
|
@ -0,0 +1,30 @@
|
|||
#lang scheme/base
|
||||
(require scheme/class
|
||||
framework
|
||||
scheme/gui/base)
|
||||
|
||||
(provide find-syntax-source-editor)
|
||||
|
||||
;; find-syntax-source-editor: syntax-source text% -> (or/c editor #f)
|
||||
;; Looks for an embedded snip editor whose source is the a-stx-source.
|
||||
;;
|
||||
;; Note: this is a copy-and-paste from syncheck.
|
||||
;; I've ripping out the editor caches for now,
|
||||
;; until I get comments from others about this.
|
||||
(define (find-syntax-source-editor a-stx-source defs-text)
|
||||
(let txt-loop ([text defs-text])
|
||||
(cond
|
||||
[(and (is-a? text text:basic<%>)
|
||||
(send text port-name-matches? a-stx-source))
|
||||
text]
|
||||
[else
|
||||
(let snip-loop ([snip (send text find-first-snip)])
|
||||
(cond
|
||||
[(not snip)
|
||||
#f]
|
||||
[(and (is-a? snip editor-snip%)
|
||||
(send snip get-editor))
|
||||
(or (txt-loop (send snip get-editor))
|
||||
(snip-loop (send snip next)))]
|
||||
[else
|
||||
(snip-loop (send snip next))]))])))
|
|
@ -26,6 +26,7 @@ TODO
|
|||
scheme/unit
|
||||
scheme/list
|
||||
"drsig.ss"
|
||||
"find-syntax-source-editor.ss"
|
||||
string-constants
|
||||
setup/xref
|
||||
scheme/gui/base
|
||||
|
@ -707,7 +708,7 @@ TODO
|
|||
(srcloc-column srcloc)
|
||||
(srcloc-position srcloc)
|
||||
(srcloc-span srcloc))]
|
||||
[(find-source-editor (srcloc-source srcloc) definitions-text)
|
||||
[(find-syntax-source-editor (srcloc-source srcloc) definitions-text)
|
||||
=>
|
||||
(lambda (editor)
|
||||
(make-srcloc editor
|
||||
|
@ -776,31 +777,6 @@ TODO
|
|||
|
||||
|
||||
|
||||
;; find-source-editor: syntax-source text% -> (or/c editor #f)
|
||||
;; Looks for an embedded snip editor whose source is the a-stx-source.
|
||||
;;
|
||||
;; Note: this is a copy-and-paste from syncheck.
|
||||
;; I've ripping out the editor caches for now,
|
||||
;; until I get comments from others about this.
|
||||
(define/private (find-source-editor a-stx-source defs-text)
|
||||
(let txt-loop ([text defs-text])
|
||||
(cond
|
||||
[(and (is-a? text text:basic<%>)
|
||||
(send text port-name-matches? a-stx-source))
|
||||
text]
|
||||
[else
|
||||
(let snip-loop ([snip (send text find-first-snip)])
|
||||
(cond
|
||||
[(not snip)
|
||||
#f]
|
||||
[(and (is-a? snip editor-snip%)
|
||||
(send snip get-editor))
|
||||
(or (txt-loop (send snip get-editor))
|
||||
(snip-loop (send snip next)))]
|
||||
[else
|
||||
(snip-loop (send snip next))]))])))
|
||||
|
||||
|
||||
(define/public (reset-highlighting)
|
||||
(reset-error-ranges))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user