[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/sly edf5d52 27/47: sbcl: Filter out invalid definitio
From: |
ELPA Syncer |
Subject: |
[nongnu] externals/sly edf5d52 27/47: sbcl: Filter out invalid definition sources in find-definitions |
Date: |
Thu, 17 Dec 2020 18:57:18 -0500 (EST) |
branch: externals/sly
commit edf5d52c9c0429a4b82879091c0f1f4cbc012ffe
Author: Zachary Beane <xach@xach.com>
Commit: João Távora <joaotavora@gmail.com>
sbcl: Filter out invalid definition sources in find-definitions
They can't be visited, so filtering them eliminates this error:
Error: DEFINITION-SOURCE of blah did not contain meaningful
information
* slynk/backend/sbcl.lisp (categorize-definition-source): Move up.
(find-definitions) Use it.
This commonly arises when a method is defined without a corresponding
defgeneric.
Cherry-picked-from: SLIME commit 8c758ba4aae8cccc8a4575e9b3f83cd42b0f5586
Co-authored-by: João Távora <joaotavora@gmail.com>
---
slynk/backend/sbcl.lisp | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/slynk/backend/sbcl.lisp b/slynk/backend/sbcl.lisp
index 9d6737f..739f0ba 100644
--- a/slynk/backend/sbcl.lisp
+++ b/slynk/backend/sbcl.lisp
@@ -826,9 +826,22 @@ QUALITIES is an alist with (quality . value)"
name
(sb-introspect::definition-source-description source-location)))
+(defun categorize-definition-source (definition-source)
+ (with-definition-source (pathname form-path character-offset plist)
+ definition-source
+ (let ((file-p (and pathname (probe-file pathname)
+ (or form-path character-offset))))
+ (cond ((and (getf plist :emacs-buffer) file-p) :buffer-and-file)
+ ((getf plist :emacs-buffer) :buffer)
+ (file-p :file)
+ (pathname :file-without-position)
+ (t :invalid)))))
+
(defimplementation find-definitions (name)
(loop for type in *definition-types* by #'cddr
- for defsrcs = (sb-introspect:find-definition-sources-by-name name type)
+ for defsrcs = (remove :invalid
+ (sb-introspect:find-definition-sources-by-name
name type)
+ :key #'categorize-definition-source)
append (loop for defsrc in defsrcs collect
(list (make-dspec type name defsrc)
(converting-errors-to-error-location
@@ -882,17 +895,6 @@ QUALITIES is an alist with (quality . value)"
(t (error "Malformed syntax in WITH-STRUCT: ~A" name))))
,@body)))))
-(defun categorize-definition-source (definition-source)
- (with-definition-source (pathname form-path character-offset plist)
- definition-source
- (let ((file-p (and pathname (probe-file pathname)
- (or form-path character-offset))))
- (cond ((and (getf plist :emacs-buffer) file-p) :buffer-and-file)
- ((getf plist :emacs-buffer) :buffer)
- (file-p :file)
- (pathname :file-without-position)
- (t :invalid)))))
-
#+#.(slynk-backend:with-symbol 'definition-source-form-number 'sb-introspect)
(defun form-number-position (definition-source stream)
(let* ((tlf-number (car (sb-introspect:definition-source-form-path
definition-source)))
- [nongnu] externals/sly b2732f4 15/47: Add line, column kw args to slynk-compile-string, (continued)
- [nongnu] externals/sly b2732f4 15/47: Add line, column kw args to slynk-compile-string, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 5ec798d 19/47: decode-arglist: don't fall on arglist-dummy., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly a0308b7 21/47: fix spurious detection of allegro modern-mode (#540), ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 9392ac9 32/47: Fix collect-macro-forms in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 3c83b6f 06/47: Improve jump to source with 'v' in sldb in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly c74ef16 14/47: Improve source locations for inlined code in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 463cef6 20/47: sbcl/sexp-in-bounds-p: descend into comma-expr., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 748fd92 22/47: Do close streams in CLOSE-LISTENER when closing SLYNK::LISTENER, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly a9502b1 25/47: abcl: fix finding slime locations within JAR archives, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly afedabc 26/47: abcl: fix inspector for Java methods and fields, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly edf5d52 27/47: sbcl: Filter out invalid definition sources in find-definitions,
ELPA Syncer <=
- [nongnu] externals/sly 0abe736 28/47: Define a macro in time, ELPA Syncer, 2020/12/17