Skip to content

racket-xp-mode shows public class methods as not bound #440

@alex-hhh

Description

@alex-hhh

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:

#lang racket
(define my-class%
  (class object% (init) (super-new)
    (define/public (say-hello)
      (printf "Hello World~%"))))
(define c (new my-class%))
(send c say-hello)

The say-hello method is obviously used, but it is shown as unused:

nbo

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:

  1. Open any racket-mode or racket-repl-mode buffer.

  2. M-x racket-bug-report ENTER.

  3. Copy and paste that, here.

((alist-get 'racket-mode package-alist))
((emacs-version "26.3")
 (emacs-uptime "9 minutes, 9 seconds")
 (system-type windows-nt)
 (major-mode racket-mode)
 (racket--el-source-dir "c:/Users/alexh/.emacs.d/lisp/racket-mode/")
 (racket--rkt-source-dir "c:/Users/alexh/.emacs.d/lisp/racket-mode/racket/")
 (racket-program "C:\\Program Files\\Racket\\Racket.exe")
 (racket-command-port 55555)
 (racket-command-timeout 10)
 (racket-memory-limit 2048)
 (racket-error-context low)
 (racket-error-context low)
 (racket-history-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'")
 (racket-images-inline t)
 (racket-images-keep-last 100)
 (racket-use-repl-submit-predicate nil)
 (racket-images-system-viewer "display")
 (racket-pretty-print t)
 (racket-indent-curly-as-sequence t)
 (racket-indent-sequence-depth 0)
 (racket-pretty-lambda nil)
 (racket-smart-open-bracket-enable nil)
 (racket-module-forms "\\s(\\(?:module[*+]?\\|library\\)")
 (racket-logger-config
  ((cm-accomplice . warning)
   (GC . info)
   (module-prefetch . warning)
   (optimizer . info)
   (racket/contract . error)
   (sequence-specialization . info)
   (* . fatal))))
(enabled-minor-modes
 (auto-composition-mode)
 (auto-compression-mode)
 (auto-encryption-mode)
 (auto-fill-mode)
 (auto-save-mode)
 (blink-cursor-mode)
 (cursor-sensor-mode)
 (diff-auto-refine-mode)
 (display-time-mode)
 (electric-indent-mode)
 (file-name-shadow-mode)
 (flyspell-mode)
 (font-lock-mode)
 (global-eldoc-mode)
 (global-font-lock-mode)
 (line-number-mode)
 (menu-bar-mode)
 (mouse-wheel-mode)
 (racket-xp-mode)
 (savehist-mode)
 (semantic-minor-modes-format)
 (show-paren-mode)
 (tooltip-mode))
(disabled-minor-modes
 (abbrev-mode)
 (auto-fill-function)
 (auto-insert-mode)
 (auto-save-visited-mode)
 (buffer-read-only)
 (bug-reference-mode)
 (bug-reference-prog-mode)
 (cl-old-struct-compat-mode)
 (column-number-mode)
 (compilation-in-progress)
 (compilation-minor-mode)
 (compilation-shell-minor-mode)
 (completion-in-region-mode)
 (cursor-intangible-mode)
 (defining-kbd-macro)
 (diff-minor-mode)
 (dired-hide-details-mode)
 (eldoc-mode)
 (electric-layout-mode)
 (electric-pair-mode)
 (electric-quote-mode)
 (flymake-mode)
 (glasses-mode)
 (global-prettify-symbols-mode)
 (global-semantic-highlight-edits-mode)
 (global-semantic-highlight-func-mode)
 (global-semantic-show-parser-state-mode)
 (global-semantic-show-unmatched-syntax-mode)
 (global-semantic-stickyfunc-mode)
 (global-visual-line-mode)
 (goto-address-mode)
 (goto-address-prog-mode)
 (horizontal-scroll-bar-mode)
 (hs-minor-mode)
 (ido-everywhere)
 (isearch-mode)
 (ispell-minor-mode)
 (jit-lock-debug-mode)
 (midnight-mode)
 (next-error-follow-minor-mode)
 (org-cdlatex-mode)
 (org-src-mode)
 (orgstruct-mode)
 (outline-minor-mode)
 (overwrite-mode)
 (paragraph-indent-minor-mode)
 (prettify-symbols-mode)
 (protect-buffer-from-kill-mode)
 (protect-process-buffer-from-kill-mode)
 (racket-smart-open-bracket-mode)
 (remember-notes-mode)
 (semantic-highlight-edits-mode)
 (semantic-highlight-func-mode)
 (semantic-mode)
 (semantic-show-parser-state-mode)
 (semantic-show-unmatched-syntax-mode)
 (semantic-stickyfunc-mode)
 (server-mode)
 (sh-electric-here-document-mode)
 (size-indication-mode)
 (sqlind-minor-mode)
 (temp-buffer-resize-mode)
 (tool-bar-mode)
 (transient-mark-mode)
 (unify-8859-on-decoding-mode)
 (unify-8859-on-encoding-mode)
 (url-handler-mode)
 (use-hard-newlines)
 (view-mode)
 (visible-mode)
 (visual-line-mode)
 (window-divider-mode)
 (xref-etags-mode))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions