Skip to content

Improve tags behavior #1326

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

Closed
wants to merge 3 commits into from
Closed
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
21 changes: 1 addition & 20 deletions haskell-cabal.el
Original file line number Diff line number Diff line change
Expand Up @@ -1097,26 +1097,7 @@ recursively avoiding visiting unnecessary heavy directories like
cabal-install, stack, etc and passes list of found files to Hasktags."
(if (eq system-type 'windows-nt)
(format "hasktags --output=\"%s\\TAGS\" -x -e \"%s\"" dir dir)
(format "cd %s && %s | %s"
dir
(concat "find . "
"-type d \\( "
"-path ./.git "
"-o -path ./.svn "
"-o -path ./_darcs "
"-o -path ./.stack-work "
"-o -path ./dist "
"-o -path ./.cabal-sandbox "
"\\) -prune "
"-o -type f \\( "
"-name '*.hs' "
"-or -name '*.lhs' "
"-or -name '*.hsc' "
"\\) -not \\( "
"-name '#*' "
"-or -name '.*' "
"\\) -print0")
"xargs -0 hasktags -e -x")))
(format "cd %s && hasktags . -e -x" dir)))

(provide 'haskell-cabal)
;;; haskell-cabal.el ends here
14 changes: 7 additions & 7 deletions haskell-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ If the definition or tag is found, the location from which you jumped
will be pushed onto `xref--marker-ring', so you can return to that
position with `xref-pop-marker-stack'."
(interactive "P")
(let ((initial-loc (point-marker))
(loc (haskell-mode-find-def (haskell-ident-at-point))))
(if (not loc)
(call-interactively 'haskell-mode-tag-find)
(haskell-mode-handle-generic-loc loc)
(unless (equal initial-loc (point-marker))
(xref-push-marker-stack initial-loc)))))
(if (haskell-session-maybe)
(let ((initial-loc (point-marker))
(loc (haskell-mode-find-def (haskell-ident-at-point))))
(haskell-mode-handle-generic-loc loc)
(unless (equal initial-loc (point-marker))
(xref-push-marker-stack initial-loc)))
(call-interactively 'haskell-mode-tag-find)))

;;;###autoload
(defun haskell-mode-goto-loc ()
Expand Down
1 change: 1 addition & 0 deletions haskell-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ be set to the preferred literate style."
(define-key map (kbd "C-c C-t") 'haskell-mode-enable-process-minor-mode)
(define-key map (kbd "C-c C-i") 'haskell-mode-enable-process-minor-mode)
(define-key map (kbd "C-c C-s") 'haskell-mode-toggle-scc-at-point)
(define-key map (kbd "M-.") 'haskell-mode-tag-find)
map)
"Keymap used in `haskell-mode'.")

Expand Down