@@ -1346,7 +1346,7 @@ Only works with Rails, see e.g. `rinari-console'."
13461346 (robe-complete-symbol-p (car bounds)))
13471347 (buffer-substring (car bounds) (cdr bounds)))))
13481348
1349- (defun robe--xref-backend () 'robe )
1349+ (defun robe--xref-backend () ( and (robe-running-p) 'robe ) )
13501350
13511351(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql 'robe )))
13521352 (let ((context (robe-context))
@@ -1379,8 +1379,6 @@ Only works with Rails, see e.g. `rinari-console'."
13791379 (cond
13801380 (at-pt
13811381 (or (robe--xref-variable-definition identifier (nth 3 context))
1382- ; ; FIXME: Probably move this check to `robe--xref-backend' .
1383- (ignore (robe-start))
13841382 (append
13851383 (robe--xref-method-definitions identifier context)
13861384 (robe--xref-module-definitions identifier (nth 1 context)))))
@@ -1431,6 +1429,11 @@ Only works with Rails, see e.g. `rinari-console'."
14311429 (list
14321430 (xref-make name var)))))
14331431
1432+ ; ; XXX: Search across the full LOAD_PATH as well?
1433+ (cl-defmethod xref-backend-references ((backend (eql 'robe )) identifier)
1434+ ; ; FIXME: Do more filtering by scope, to remove definite non-matches.
1435+ (cl-call-next-method backend (car (last (string-split identifier " ::\\ |#\\ |\\ ." )))))
1436+
14341437(cl-defmethod xref-location-marker ((var robe--variable))
14351438 (save-excursion
14361439 (save-restriction
@@ -1490,8 +1493,6 @@ Only works with Rails, see e.g. `rinari-console'."
14901493 (file-relative-name file dir)
14911494 file)))
14921495
1493- ; ; TODO: `xref-backend-references' across LOAD_PATH.
1494-
14951496(defvar robe-mode-map
14961497 (let ((map (make-sparse-keymap )))
14971498 (define-key map (kbd " C-c C-d" ) 'robe-doc )
0 commit comments