racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
444 stars 93 forks source link

'Open Defining File' / 'Jump to definition(in other file)' opens wrong file #668

Open spdegabrielle opened 2 months ago

spdegabrielle commented 2 months ago

Steps to reproduce :

  1. create two sibling folders test and test3 (I did this in Downloads)
  2. create file test/test1.rkt
  3. create file test/test2.rkt
  4. create file test3/test1.rkt
  5. create file test3/test2.rkt
  6. open each file in doctor in a new tab
  7. run test/test1.rkt - works as expected
  8. run test3/test1.rkt - works as expected
  9. in test3/test1.rkt tab, right click on (show-me2) and select 'Jump to Definition (in Other File)' - goes to (define (show-me2) in test3/test2.rkt as expected
  10. go to tab for test/test1.rkt and right click on (show-me2) and select 'Jump to Definition (in Other File)' --- incorrectly goes to (define (show-me) in test3/test2.rkt (I expected it to open the required test/test2.rkt).

Files

test/test1.rkt

#lang at-exp Racket
(require "test2.rkt")
(displayln "this is test/test1")

(show-me)

test/test2.rkt

#lang at-exp Racket
(provide show-me)
(define (show-me)
  (displayln "this is test/test2"))

test3/test1.rkt

#lang at-exp Racket
(require "test2.rkt")
(displayln "this is test3/test1")

(show-me)

test3/test2.rkt

#lang at-exp Racket
(provide show-me)
(define (show-me)
  (displayln "this is test3/test2"))

Reproduced on Welcome to DrRacket, version 8.12 [cs]. Language: at-exp racket, with debugging and profiling [custom]; memory limit: 128 MB. 8.12 (macOS 14.4.1 / M1)

Demonstration on 8.11 (win10) open-defining-file

jbclements commented 2 months ago

So many thanks for filing this issue! I've been experiencing this for several months, and never had time to put together a good issue or see how reproducible it is.

spdegabrielle commented 2 months ago

. I’m still confused because if I right click on the ‘require’d filename it opens the correct file.

jbclements commented 2 months ago

Yep, that was my observation as well.