Skip to content

use xref-find-definitons' instead of find-tag' #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions haskell-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ happened since function invocation)."
(defun haskell-process-generate-tags (&optional and-then-find-this-tag)
"Regenerate the TAGS table.
If optional AND-THEN-FIND-THIS-TAG argument is present it is used with
function `find-tag' after new table was generated."
function `xref-find-definitions' after new table was generated."
(interactive)
(let ((process (haskell-interactive-process)))
(haskell-process-queue-command
Expand Down Expand Up @@ -730,7 +730,7 @@ function `find-tag' after new table was generated."
(haskell-process-session (car state)))))
(add-to-list 'tags-table-list session-tags)
(setq tags-file-name nil))
(find-tag (cdr state)))
(xref-find-definitions (cdr state)))
(haskell-mode-message-line "Tags generated."))))))

(defun haskell-process-add-cabal-autogen ()
Expand Down
6 changes: 6 additions & 0 deletions haskell-compat.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ A process is considered alive if its status is `run', `open',
(unless (fboundp 'outline-show-subtree)
(defalias 'outline-show-subtree 'show-subtree))

(unless (fboundp 'xref-find-definitions)
(defun xref-find-definitions (ident)
(let ((next-p (and (boundp 'xref-prompt-for-identifier)
xref-prompt-for-identifier)))
(find-tag ident next-p))))

(provide 'haskell-compat)

;;; haskell-compat.el ends here
3 changes: 2 additions & 1 deletion haskell.el
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@
(tags-revert-without-query t))
(when (and ident (not (string= "" (haskell-string-trim ident))))
(cond ((file-exists-p tags-file-name)
(find-tag ident next-p))
(let ((xref-prompt-for-identifier next-p))
(xref-find-definitions ident)))
(t (haskell-process-generate-tags ident))))))

;;;###autoload
Expand Down