Skip to content

Commit

Permalink
Avoid <internal:... file names too
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov committed Mar 19, 2024
1 parent f82f3a5 commit 863dcfc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions robe.el
Original file line number Diff line number Diff line change
Expand Up @@ -1384,11 +1384,15 @@ Only works with Rails, see e.g. `rinari-console'."
(lambda (spec)
(xref-make (concat
(robe-signature spec)
(when (null (robe-spec-file spec))
(when (robe--xref-method-nofile-p spec)
(propertize " <no location>" 'face 'shadow)))
(xref-make-robe-method-location spec)))
specs)))

(defun robe--xref-method-nofile-p (spec)
(or (null (robe-spec-file spec))
(string-prefix-p "<internal:" (robe-spec-file spec))))

(defun robe--xref-module-definitions (name context-module)
(let* ((search-result (robe-request "const_locations" name context-module))
(resolved-name (assoc-default 'resolved_name search-result))
Expand Down Expand Up @@ -1432,7 +1436,7 @@ Only works with Rails, see e.g. `rinari-console'."

(cl-defmethod xref-location-marker ((l xref-robe-method-location))
(pcase-let (((cl-struct xref-robe-method-location spec) l))
(if (null (robe-spec-file spec))
(if (robe--xref-method-nofile-p spec)
(user-error
(substitute-command-keys
"Can't jump to a C method. Use `\\[robe-doc]' instead."))
Expand Down

0 comments on commit 863dcfc

Please sign in to comment.