Skip to content

Commit

Permalink
Don't raise an error when no symbol is found at a point
Browse files Browse the repository at this point in the history
  • Loading branch information
atodekangae committed Nov 3, 2020
1 parent 97b0dfb commit 2b64ddb
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions dumb-jump.el
Original file line number Diff line number Diff line change
Expand Up @@ -3006,11 +3006,13 @@ Using ag to search only the files found via git-grep literal symbol search."
"2020-06-26")

(cl-defmethod xref-backend-identifier-at-point ((_backend (eql dumb-jump)))
(let ((start (dumb-jump--get-symbol-start)))
(and start (let* ((ident (dumb-jump-get-point-symbol))
(line (dumb-jump-get-point-line))
(ctx (dumb-jump-get-point-context line ident start)))
(propertize ident :dumb-jump-ctx ctx)))))
(let ((bounds (bounds-of-thing-at-point 'symbol)))
(and bounds (let* ((ident (dumb-jump-get-point-symbol))
(start (car bounds))
(col (- start (point-at-bol)))
(line (dumb-jump-get-point-line))
(ctx (dumb-jump-get-point-context line ident col)))
(propertize ident :dumb-jump-ctx ctx)))))

(cl-defmethod xref-backend-definitions ((_backend (eql dumb-jump)) prompt)
(let* ((info (dumb-jump-get-results prompt))
Expand Down Expand Up @@ -3061,7 +3063,10 @@ Using ag to search only the files found via git-grep literal symbol search."
match-cur-file-front))))))

(cl-defmethod xref-backend-apropos ((_backend (eql dumb-jump)) pattern)
(xref-backend-definitions 'dumb-jump pattern)))
(xref-backend-definitions 'dumb-jump pattern))

(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql dumb-jump)))
nil))

;;;###autoload
(defun dumb-jump-xref-activate ()
Expand Down

0 comments on commit 2b64ddb

Please sign in to comment.