Skip to content

Commit 60f2bb1

Browse files
committed
Merge pull request #657 from deviant-logic/pr/switch-to-xref-find-definitions
Use `xref-find-definitons' instead of `find-tag'
2 parents 6097e2f + a757501 commit 60f2bb1

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

haskell-commands.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ happened since function invocation)."
702702
(defun haskell-process-generate-tags (&optional and-then-find-this-tag)
703703
"Regenerate the TAGS table.
704704
If optional AND-THEN-FIND-THIS-TAG argument is present it is used with
705-
function `find-tag' after new table was generated."
705+
function `xref-find-definitions' after new table was generated."
706706
(interactive)
707707
(let ((process (haskell-interactive-process)))
708708
(haskell-process-queue-command
@@ -730,7 +730,7 @@ function `find-tag' after new table was generated."
730730
(haskell-process-session (car state)))))
731731
(add-to-list 'tags-table-list session-tags)
732732
(setq tags-file-name nil))
733-
(find-tag (cdr state)))
733+
(xref-find-definitions (cdr state)))
734734
(haskell-mode-message-line "Tags generated."))))))
735735

736736
(defun haskell-process-add-cabal-autogen ()

haskell-compat.el

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ A process is considered alive if its status is `run', `open',
5959
(unless (fboundp 'outline-show-subtree)
6060
(defalias 'outline-show-subtree 'show-subtree))
6161

62+
(unless (fboundp 'xref-find-definitions)
63+
(defun xref-find-definitions (ident)
64+
(let ((next-p (and (boundp 'xref-prompt-for-identifier)
65+
xref-prompt-for-identifier)))
66+
(find-tag ident next-p))))
67+
6268
(provide 'haskell-compat)
6369

6470
;;; haskell-compat.el ends here

haskell.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@
314314
(tags-revert-without-query t))
315315
(when (and ident (not (string= "" (haskell-string-trim ident))))
316316
(cond ((file-exists-p tags-file-name)
317-
(find-tag ident next-p))
317+
(let ((xref-prompt-for-identifier next-p))
318+
(xref-find-definitions ident)))
318319
(t (haskell-process-generate-tags ident))))))
319320

320321
;;;###autoload

0 commit comments

Comments
 (0)