Skip to content

Commit

Permalink
Faster xref-backend-identifier-completion-table
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutov committed Mar 26, 2024
1 parent 9c313f8 commit cd2d7da
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions robe.el
Original file line number Diff line number Diff line change
Expand Up @@ -1351,14 +1351,17 @@ Only works with Rails, see e.g. `rinari-console'."
(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql 'robe)))
(let ((context (robe-context))
;; TODO: Optimize.
(specs (robe-request "complete_method" "" "a" nil t)))
(method_specs (robe-request "complete_method" "" "a" nil t))
str)
(mapcar (lambda (spec)
;; Much faster than `robe-signature'.
(propertize (concat (or (robe-spec-module spec) "?")
(if (robe-spec-inst-p spec) "#" ".")
(robe-spec-method spec))
'robe-spec spec))
specs)))
(setq str
(concat (or (robe-spec-module spec) "?")
(if (robe-spec-inst-p spec) "#" ".")
(robe-spec-method spec)))
(put-text-property 0 1 'robe-spec spec str)
str)
method_specs)))

(cl-defmethod xref-backend-identifier-at-point ((_backend (eql 'robe)))
(robe--jump-thing))
Expand Down

0 comments on commit cd2d7da

Please sign in to comment.