(cl-defmethod xref-backend-references ((_backend (eql 'sweep)) mfn)
(let ((refs (sweep-predicate-references mfn)))
(seq-map (lambda (loc)
- (let ((path (car loc))
- (line (or (cdr loc) 1)))
- (xref-make (concat path ":" (number-to-string line)) (xref-make-file-location path line 0))))
+ (let ((by (car loc))
+ (path (cadr loc))
+ (line (or (cddr loc) 1)))
+ (xref-make by (xref-make-file-location path line 0))))
refs)))
(cl-defmethod xref-backend-apropos ((_backend (eql 'sweep)) pattern)
:- dynamic sweep_current_identifier_at_point/1.
-
sweep_identifier_at_point_(Path0, Point, Contents, Identifier) :-
atom_string(Path, Path0),
( xref_module(Path, M)
sweep_predicate_references(MFN, Refs) :-
term_string(M:F/N, MFN),
pi_head(F/N, H),
- findall([Path|Line],
- (xref_called(Path0, H, _, _, Line),
+ findall([B,Path|Line],
+ (xref_called(Path0, H, B0, _, Line),
+ pi_head(B1, B0),
+ term_string(B1, B),
atom_string(Path0, Path)),
Refs,
Tail),
- findall([Path|Line],
- (xref_called(Path0, M:H, _, _, Line),
+ findall([B,Path|Line],
+ (xref_called(Path0, M:H, B0, _, Line),
+ pi_head(B1, B0),
+ term_string(B1, B),
atom_string(Path0, Path)),
Tail).