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

racket-xp-mode reports "defined locally" and imported, both?

Open greghendershott opened this issue 1 year ago • 0 comments

In this little program:

#lang racket
(define-syntax when-not (make-rename-transformer #'unless))
(unless #f 42)

racket-xp-mode reports that unless is both "imported from racket", and, "defined locally":

arrow-rename-transformer-emacs

Racket Mode adds the "defined locally" when syncheck:add-arrow/name-dup/pxpy has a false require-arrow.


DrRacket using arrows:

With the mouse pointer over unless:

arrow-rename-transformer-drracket

With the mouse pointer over when-not (disregard the caret in the screenshot, it's misleading; the mouse pointer is actually over when-not):

arrow-rename-transformer-drracket-2

In other words there is a non-import arrow from unless to when-not -- but also a non-import arrow in the opposite direction. This doesn't make sense to me; I'm not sure if it's a small bug in check-syntax, or, a big defect in my understanding of macros. Anyway, given that information, I don't see how Racket Mode can do otherwise here. Fortunately jump-to-definition does work correctly, going from unless to its actual definition (not to when-not).

greghendershott avatar Sep 01 '22 14:09 greghendershott