racket / racket/drracket

racket/unit behavior "bleeds through" to different file

Open
#452 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

I just found a fun little bug that appears to go back to at least racket v7.5. It appears that under some circumstances, opening a file not written in the racket/unit language can trigger a warning about missing imports, along with a clearly bogus highlight.

Steps to reproduce:

  1. delete your proferences. On MacOS Catalina, go to ~/Library/Preferences, delete org.racket-lang.*
  2. Open DrRacket.
  3. use flower-l, flower-r to choose "The Racket Language".
  4. Enter this program:
#lang scheme/signature
  1. Run.
    5a) Save the new file to /tmp/zz.rkt.
  2. Open a fresh tab.
  3. open the stepper/private/view-controller.rkt file (easiest using cmd-shift-o).
  4. Find the "import" clause on line 37, comment it out. (See error at bottom.)
  5. Save the file.
  6. Open the file "xml-sig.rkt" in the same directory.
  7. The interactions window should now show the error "#%module-begin: missing an `import' clause in: (#%module-begin)", and the red highlight should highlight part of scheme/signature. (See screenshot.) This state seems clearly wrong to me because the scheme/signature language should not require an import clause, and DrRacket should never highlight just part of an identifier.
Screen Shot 2021-01-17 at 5 34 38 PM

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in DrRacket using the provided preference-reset and file-opening steps, starting with stepper/private/view-controller.rkt and then xml-sig.rkt. Inspect the interaction-window error and red highlight after commenting out the import clause. Done means opening xml-sig.rkt no longer inherits the racket/unit behavior, reports a missing import for scheme/signature, or highlights only part of the identifier.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.