racket-mode icon indicating copy to clipboard operation
racket-mode copied to clipboard

Tolerate broken Typed Racket

Open greghendershott opened this issue 4 years ago • 4 comments

@samth reported on Slack that breaking Typed Racket now breaks Racket Mode.

For example "go to the typed-racket/main.rkt and add an extra (".

It breaks it because racket-mode now (transitively) depends on TR, so starting racket-mode fails I think it's because drracket/check-syntax transitively depends on TR maybe because the blueboxes code is typed

I suggested temporarily disabling racket-xp-mode until the error is resolved. But:

  • Try that, confirm that works.
  • Think about how to improve the experience. Maybe the Racket Mode back end check-syntax command could fail in a more graceful way (using dynamic-require and/or with-handlers) such that the front end racket-xp-mode could disable or limit itself in a more-graceful way.

greghendershott avatar Apr 29 '20 13:04 greghendershott

@samth Actually which "main.rkt" file do you mean? I don't have any in Racket 7.6.

When I add an unclosed ( to (just guessing) typed-racket-lib/typed/racket/base.rkt things actually work fine for me.

At first I thought, well that's because the Racket Mode back end was already loaded, as a result of racket-xp-mode starting it for some other file. But, even when I M-x racket-stop-back-end, then visit the munged base.rkt, the back end still starts fine.

So, this issue seems to be related to some very specific file?? Or I'm just not understanding.

greghendershott avatar Apr 29 '20 16:04 greghendershott

The particular file I broke was typed-racket/utils/prefab-c.rkt.

samth avatar Apr 29 '20 17:04 samth

Hmm I still can't reproduce with that file. Even when I ensure the back end is stopped before visiting the file, such that it would be started and elicit some error due to any dependence on Typed Racket.

  1. Can you show me details about the error that you see?

  2. In a racket-mode buffer, if you C-h v and enter eldoc-documentation-function, what is the value? The default for racket-mode is nil, which is what I have. If you had set it to racket-xp-eldoc-function, that might explain this. Does setting it to nil fix this problem? Please let me know either way?

greghendershott avatar Apr 30 '20 14:04 greghendershott

Commit 47b9041 in February added support for blueboxes to racket-xp-eldoc-function. But by default that function is not used.

greghendershott avatar Apr 30 '20 14:04 greghendershott