Open shhyou opened 2 days ago
@rfindler
i know this investigation but the meta-error message about get-tab
seems to suggest this is a miscommunication among some drracke comments.
I'm having trouble reproducing the error. It seems like, when I create a new frame and don't hit Run the button (but because the language was already set I'll have a REPL) and then I evaluate a failing check-expect, I get a nearby error, but it seems to happen on the line after the one in @shhyou 's report (below).
Is it possible I'm missing a step to reproduce?
send: target is not an object
target: #f
method name: get-frame
context...:
/Users/robby/git/plt/racket/collects/racket/private/class-internal.rkt:4730:0: obj-error
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/framework/private/srcloc-snip.rkt:36:2: show-editor
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/framework/private/srcloc-snip.rkt:20:4: frame-loop
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/mred/private/wxme/text.rkt:537:2: on-default-event method in text%
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/mred/private/wxme/editor-canvas.rkt:412:2: on-event method in editor-canvas%
/Users/robby/git/plt/racket/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
/Users/robby/git/plt/racket/collects/racket/private/more-scheme.rkt:266:2: call-with-exception-handler
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/mred/private/wx/cocoa/window.rkt:899:4: dispatch-on-event method in window%
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:436:6
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:487:32
/Users/robby/git/plt/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:639:3
Does this change make a difference?
diff --git a/gui-lib/framework/private/srcloc-snip.rkt b/gui-lib/framework/private/srcloc-snip.rkt
index ee6cbd17..92ca4308 100644
--- a/gui-lib/framework/private/srcloc-snip.rkt
+++ b/gui-lib/framework/private/srcloc-snip.rkt
@@ -33,7 +33,11 @@
[else
(frame-loop (cdr frames))])))))
- (define (show-editor frame editor)
+ (define (show-editor frame _editor)
+ (define editor
+ (if (method-in-interface? 'get-definitions-text (object-interface _editor))
+ (send _editor get-definitions-text)
+ _editor))
(let* ([current-tab (send editor get-tab)]
[frame (send current-tab get-frame)])
(let loop ([tabs (send frame get-tabs)] [i 0])
Also, as I'm looking at this code, it does seem a little weird. It definitely expects that DrRacket-specific methods are existing on the frame but it is part of the framework. So probably it should either move into DrRacket somehow, or it should change to use only framework functionality (and check for that functionality's existence).
The latter option can't be done entirely, tho, because the framework doesn't have an equivalent of the highlight-error
method on the interactions window. It may be possible to abstract over that functionality and pass in a function to the constructor of a srcloc snip that defaults to just, say, setting the position or something.
I'm having trouble reproducing the error. It seems like, when I create a new frame and don't hit Run the button (but because the language was already set I'll have a REPL) and then I evaluate a failing check-expect, I get a nearby error, but it seems to happen on the line after the one in @shhyou 's report (below).
Is it possible I'm missing a step to reproduce?
I am using #lang based SLs. Menu-based SLs don't have this issue.
The latter option can't be done entirely, tho, because the framework doesn't have an equivalent of the highlight-error method on the interactions window. It may be possible to abstract over that functionality and pass in a function to the constructor of a srcloc snip that defaults to just, say, setting the position or something.
Meanwhile, highlighting after clicking the hyperlink is currently working in menu-based SLs. Can #lang based SLs use the same mechanism?
The test engine source hyperlinks are not working for check-expects in REPL.
Expected behavior: highlight the failing check-expect Actual behavior:
In a saved editor: nothing happenedalso got the error message