Commit be72bafd authored by jao's avatar jao

racket: correctly jump to symbols defined in .ss modules

Racket is returning by default their canonical "rkt" name, which
sometimes is not what's in the filesystem.
parent d23e8367
......@@ -4,6 +4,8 @@ Bug fixes:
- Racket: correctly reloading modules that contain submodules (this
one was breaking for instance code based on plai-typed).
- Racket: correctly jumping to symbols defined in files with .ss
extension.
New features:
......
;;; locations.rkt -- locating symbols
;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
;; Copyright (C) 2009, 2010, 2012 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
......@@ -29,10 +29,17 @@
(module-path-index-resolve (car binding))))
(cons sym #f))))
(define (switch-extension path)
(if (regexp-match? "\\.rkt$" path)
(regexp-replace "\\.rkt$" path ".ss")
(regexp-replace "\\.ss$" path ".rkt")))
(define (make-location name path line)
(list (cons "name" name)
(cons "file" (if (path? path) (path->string path) '()))
(cons "line" (or line '()))))
(let* ([path (if (path? path) (path->string path) #f)]
[path (and path (if (file-exists? path) path (switch-extension path)))])
(list (cons "name" name)
(cons "file" (or path '()))
(cons "line" (or line '())))))
(define (symbol-location sym)
(let* ([loc (symbol-location* sym)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment