[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/slime fcd6bccffd 25/44: clasp: new xref implementation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/slime fcd6bccffd 25/44: clasp: new xref implementation |
Date: |
Fri, 29 Dec 2023 01:00:04 -0500 (EST) |
branch: elpa/slime
commit fcd6bccffd5eee9e11b5540536d940e088744378
Author: Bike <aeshtaer@gmail.com>
Commit: Stas Boukarev <stassats@gmail.com>
clasp: new xref implementation
Conditionalized like SBCL's so it should work with old Clasps.
---
swank/clasp.lisp | 45 +++++++++++++++++++++++++++++++++++++++------
1 file changed, 39 insertions(+), 6 deletions(-)
diff --git a/swank/clasp.lisp b/swank/clasp.lisp
index 3574822b60..5f301f3f96 100644
--- a/swank/clasp.lisp
+++ b/swank/clasp.lisp
@@ -28,6 +28,13 @@
(when (find-symbol "TEMPORARY-DIRECTORY" "EXT")
(pushnew :temporary-directory *features*)))
+;;; Compatibility tests
+
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ ;; xref support (2.4)
+ (defun clasp-with-xref-p ()
+ (with-symbol 'who-calls 'ext)))
+
;;; Swank-mop
(eval-when (:compile-toplevel :load-toplevel :execute)
@@ -380,6 +387,24 @@
(or (subtypep nil symbol)
(not (eq (type-specifier-arglist symbol) :not-available))))
+;;; XREF
+
+#+#.(swank/clasp::clasp-with-xref-p)
+(macrolet ((defxref (name &optional (fname name))
+ `(defimplementation ,name (what)
+ (let ((r (,(find-symbol (symbol-name fname) "EXT")
+ what)))
+ (loop for (fname . spi) in r
+ collect (list fname (translate-spi spi)))))))
+ (defxref who-calls)
+ (defxref who-binds)
+ (defxref who-sets)
+ (defxref who-references)
+ (defxref who-macroexpands)
+ (defxref who-specializes who-specializes-directly)
+ (defxref list-callers)
+ (defxref list-callees))
+
;;; Debugging
@@ -451,13 +476,21 @@
(defimplementation print-frame (frame stream)
(clasp-debug:prin1-frame-call frame stream))
+(defun translate-spi (spi)
+ (if spi
+ (let ((pathname (clasp-debug:code-source-line-pathname spi)))
+ (if pathname
+ (make-location (list :file (namestring (translate-logical-pathname
pathname)))
+ (list :line
(clasp-debug:code-source-line-line-number spi))
+ '(:align t))
+ nil))
+ nil))
+
(defimplementation frame-source-location (frame-number)
- (let ((csl (clasp-debug:frame-source-position (frame-from-number
frame-number))))
- (if (clasp-debug:code-source-line-pathname csl)
- (make-location (list :file (namestring (translate-logical-pathname
(clasp-debug:code-source-line-pathname csl))))
- (list :line (clasp-debug:code-source-line-line-number
csl))
- '(:align t))
- `(:error ,(format nil "No source for frame: ~a" frame-number)))))
+ (or (translate-spi
+ (clasp-debug:frame-source-position
+ (frame-from-number frame-number)))
+ `(:error ,(format nil "No source for frame: ~a" frame-number))))
(defimplementation frame-locals (frame-number)
(loop for (var . value)
- [nongnu] elpa/slime 2df69effea 03/44: clasp: cleanup old debugging code, (continued)
- [nongnu] elpa/slime 2df69effea 03/44: clasp: cleanup old debugging code, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime e6a71c725c 09/44: slime-repl: reset the output column on new evaluation., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 5e8fc7cad5 11/44: slime-repl: reset the output column in the right way., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime e193bc5f34 12/44: I'm not your brother, pal., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime dd179f4a0c 13/44: Rework swank.asd to produce actual compilation artifact (#760), ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 117bbf0d3c 15/44: abcl: fix for abcl-1.8.0, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 8f166c4149 18/44: Align compilation artifact paths in swank-loader with ASDF, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 31c5449848 20/44: Fix build under SBCL, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime d5b8da7ce1 21/44: eliminate package variance warning on SBCL, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 65ab630434 35/44: Inspect definition: handle eql specializers., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime fcd6bccffd 25/44: clasp: new xref implementation,
ELPA Syncer <=
- [nongnu] elpa/slime 735258a26b 29/44: Handle case when there is no emacs-connection., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 1e4b7417a1 24/44: slime-definition-at-point: consider non-top level definitions., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 96de8b0baa 16/44: abcl: conditionalize use of Gray Streams, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 86f0dc306f 33/44: disassemble/inspect-definition: use the method of DEFMETHOD., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 2063445ce5 34/44: slime-in-expression-p: match symbols case-insensitively., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 6f521dd980 40/44: slime-parse-toplevel-form: move ignore-errors., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime da5c14434d 14/44: Update ci.yml, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 0cc2e73611 27/44: inspector: show array-displacement., ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 46714e8eef 26/44: Fix typo in message shown when inspecting a macro, ELPA Syncer, 2023/12/29
- [nongnu] elpa/slime 607fa638f1 37/44: clasp: Close temp file before compile-file, ELPA Syncer, 2023/12/29