racket / racket/drracket

"Jump to Next Bound Occurrence" - Strange behavior with imported symbols

Open
#193 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Consider the following 2 racket programs:

foo.rkt

#lang racket/base
(define foo "fooey")
(define bar 25)
(provide (all-defined-out))

bar.rkt

#lang racket/base
(require "foo.rkt")
(let ([x foo] [y bar])
  (printf "~v~n~v~n" foo bar))

If one navigates to to the foo reference on line 3 of bar.rkt and selects "jump to next bound occurrence", one would expect DrRacket to highlight the foo reference on line 4. What DrRacket actually does is highlight the reference to bar on line 3. It appears that DrRacket cannot distinguish between different symbols imported from the same file, and thus treats all symbols imported from a given file as being the equivalent for the purposes of code navigation.

This issue also applies to symbols imported from #lang statements. Using the same example above, if one navigates to the let reference on line 3 and selects "jump to next bound occurrence", DrRacket to will highlight the reference to printf on line 4.

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 behavior in DrRacket using the foo.rkt and bar.rkt examples from the issue, including imported symbols and #lang references. Verify that “Jump to Next Bound Occurrence” follows the selected binding, highlighting the next foo reference rather than bar or printf.

Written by the indexing model from the issue text.

Assessment

Domain
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.