Skip to content

Commit 1018f6a

Browse files
committed
Use hasktags command composer
1 parent 6e425db commit 1018f6a

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

haskell-commands.el

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
(require 'haskell-presentation-mode)
3636
(require 'haskell-utils)
3737
(require 'highlight-uses-mode)
38+
(require 'haskell-cabal)
3839

3940
;;;###autoload
4041
(defun haskell-process-restart ()
@@ -700,20 +701,13 @@ function `xref-find-definitions' after new table was generated."
700701
process
701702
(make-haskell-command
702703
:state (cons process and-then-find-this-tag)
703-
:go (lambda (state)
704-
(if (eq system-type 'windows-nt)
705-
(haskell-process-send-string
706-
(car state)
707-
(format ":!hasktags --output=\"%s\\TAGS\" -x -e \"%s\""
708-
(haskell-session-cabal-dir (haskell-process-session (car state)))
709-
(haskell-session-cabal-dir (haskell-process-session (car state)))))
710-
(haskell-process-send-string
711-
(car state)
712-
(format ":!cd %s && %s | %s"
713-
(haskell-session-cabal-dir
714-
(haskell-process-session (car state)))
715-
"find . -type d \\( -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"
716-
"xargs -0 hasktags -e -x"))))
704+
:go
705+
(lambda (state)
706+
(let* ((process (car state))
707+
(cabal-dir (haskell-session-cabal-dir
708+
(haskell-process-session process)))
709+
(command (haskell-cabal--compose-hasktags-command cabal-dir)))
710+
(haskell-process-send-string process command)))
717711
:complete (lambda (state _response)
718712
(when (cdr state)
719713
(let ((tags-file-name

0 commit comments

Comments
 (0)