log errors that read-language produces when DrRacket calls it
This commit is contained in:
parent
af73e6f274
commit
3250d97f71
|
@ -155,7 +155,12 @@
|
||||||
;; info-result : (or/c #f [#lang without a known language]
|
;; info-result : (or/c #f [#lang without a known language]
|
||||||
;; (vector <get-info-proc>) [no #lang line, so we use the '#lang racket' info proc]
|
;; (vector <get-info-proc>) [no #lang line, so we use the '#lang racket' info proc]
|
||||||
;; <get-info-proc> [the get-info proc for the program in the definitions]
|
;; <get-info-proc> [the get-info proc for the program in the definitions]
|
||||||
[info-result (with-handlers ((exn:fail? (λ (x) #f)))
|
[info-result (with-handlers ((exn:fail?
|
||||||
|
(λ (x)
|
||||||
|
(log-debug (format "DrRacket: error duing call to read-language for ~a:\n ~a"
|
||||||
|
(or (send this get-filename) "<<unsaved file>>")
|
||||||
|
(regexp-replace* #rx"\n(.)" (exn-message x) "\n\\1 ")))
|
||||||
|
#f)))
|
||||||
(read-language
|
(read-language
|
||||||
port
|
port
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
|
@ -273,6 +273,9 @@ as the @racket[_key] argument to the @racket[_get-info] function to do so:
|
||||||
@item{@language-info-ref[drracket:opt-out-toolbar-buttons]}
|
@item{@language-info-ref[drracket:opt-out-toolbar-buttons]}
|
||||||
@item{@language-info-ref[color-lexer]}]
|
@item{@language-info-ref[color-lexer]}]
|
||||||
|
|
||||||
|
If the call to @racket[read-language] raises an error, DrRacket logs the
|
||||||
|
error via @racket[log-debug].
|
||||||
|
|
||||||
@language-info-def[color-lexer]{
|
@language-info-def[color-lexer]{
|
||||||
When a language's @racket[_get-info] procedure responds to @racket['color-lexer], it
|
When a language's @racket[_get-info] procedure responds to @racket['color-lexer], it
|
||||||
is expected to return a procedure suitable to pass as the @racket[_get-token]
|
is expected to return a procedure suitable to pass as the @racket[_get-token]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user