Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial support for find-source-location with functions

  • Loading branch information...
commit 2791323a6cc4f1c9f8f8cb4ce2dfa43ded5eba5a 1 parent 324ab80
Geo Carncross authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 swank-ecl.lisp
View
16 swank-ecl.lisp
@@ -302,6 +302,22 @@
(defimplementation find-definitions (name) nil)
+(defimplementation find-source-location (obj)
+ (or
+ (typecase obj
+ (function
+ (multiple-value-bind (file pos) (ignore-errors (si:bc-file obj))
+ (if (and file pos)
+ `(:location
+ (:file ,file)
+ (:position ,pos)
+ (:snippet
+ ,(with-open-file (s file)
+ (skip-toplevel-forms pos s)
+ (skip-comments-and-whitespace s)
+ (read-snippet s))))))))
+ `(:error (format nil "Source definition of ~S not found" obj))))
+
;;;; Threads
#+threads
Please sign in to comment.
Something went wrong with that request. Please try again.