Open alex-hhh opened 4 years ago
When I try that in Dr Racket and mouse hover on say-hello
it shows the same tooltip, "no bound occurrences". The underlying analysis by drracket/check-syntax
says that it is unbound a.k.a. unused.
The difference in Racket Mode is that it "surfaces this in the UI" more prominently. As a result it's going to make more evident any bugs, edge cases, or omissions in the analysis done by drracket/check-syntax
.
Another case is https://github.com/racket/drracket/issues/110 which I've attempted to fix with PR https://github.com/racket/drracket/pull/362.
Also, in some cases the "blame" isn't really even drracket/check-syntax
. One such example: (provide (all-defined-out))
. The problem you're reporting might need to be fixed in racket/class
, or in drracket/check-syntax
, I don't yet know which.
Probably we should open this as an issue, also, at https://github.com/racket/drracket/issues ? If you agree, and you'd like to go ahead and do that, and link back to this issue here, that would be great. Otherwise I will.
I am not sure where the right place to fix this would be, as I'm not familiar with the inner workings of drracket/check-syntax
(or most of Racket itself, actually :-) ), so feel free to move this issue into a more appropriate project.
The workaround for me would be to change the face in Emacs, so they are not crossed out, as the most annoying part is when I open a Racket source file and have all the method names crossed out. It looks like this is the approach DrRacket takes (unbound names are not crossed out)
The underlying analysis by drracket/check-syntax says that it is unbound a.k.a. unused.
I am not sure that "unbound" and "unused" are synonyms: in my original example, say-hello
is in fact unbound, but it is actually used.
For that work-around, you can customize racket-xp-unused-face
to something like '(inherit default)
.
You won't see other, truly unused identifiers. It would be nice if Racket Mode could distinguish this, but, that's kind of the essence of the problem here. :smile:
I'll open an issue on the drracket
repo and see if Robby thinks it's something that can/should be fixed there, or in racket/class
.
I'm trying out the new
racket-xp-mode
and I noticed that it marks all public class methods as unbound occurrences and crosses them out. Here is an example:The
say-hello
method is obviously used, but it is shown as unused:It seems that functions which are exported from the module are not marked as "not used" even if they are not called from within a module. Perhaps public methods could also be treated the same?
My code base uses classes public methods extensively and they all show crossed out.
To help me help you, please:
Open any racket-mode or racket-repl-mode buffer.
M-x
racket-bug-report
ENTER.Copy and paste that, here.