Skip to content

Commit 1919b7d

Browse files
committed
fallback to tags if there is no haskell-session
The function name & docs suggest this is the intended behavior. `haskell-mode-find-def` errors if there is no session, so we need to only call it if there is a session. closes #1180
1 parent 69291d2 commit 1919b7d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

haskell-commands.el

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,13 @@ If the definition or tag is found, the location from which you jumped
350350
will be pushed onto `xref--marker-ring', so you can return to that
351351
position with `xref-pop-marker-stack'."
352352
(interactive "P")
353-
(let ((initial-loc (point-marker))
354-
(loc (haskell-mode-find-def (haskell-ident-at-point))))
355-
(if (not loc)
356-
(call-interactively 'haskell-mode-tag-find)
357-
(haskell-mode-handle-generic-loc loc)
358-
(unless (equal initial-loc (point-marker))
359-
(xref-push-marker-stack initial-loc)))))
353+
(if (haskell-session-maybe)
354+
(let ((initial-loc (point-marker))
355+
(loc (haskell-mode-find-def (haskell-ident-at-point))))
356+
(haskell-mode-handle-generic-loc loc)
357+
(unless (equal initial-loc (point-marker))
358+
(xref-push-marker-stack initial-loc)))
359+
(call-interactively 'haskell-mode-tag-find)))
360360

361361
;;;###autoload
362362
(defun haskell-mode-goto-loc ()

0 commit comments

Comments
 (0)