[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 411268e 310/385: improve hsinspect error
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 411268e 310/385: improve hsinspect error messages |
Date: |
Tue, 5 Oct 2021 23:59:54 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 411268e00081140d2bfc524d81db248a56e306ed
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
improve hsinspect error messages
---
haskell-tng-hsinspect.el | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 5c7eabe..79b2ccc 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -33,13 +33,13 @@ name of the symbol at point in the minibuffer.
A prefix argument ensures that caches are flushes."
(interactive "P")
- (when-let* ((sym (haskell-tng--hsinspect-symbol-at-point))
- (found (seq-find
- (lambda (names) (member sym (seq-map #'cdr names)))
- (haskell-tng--hsinspect-imports nil alt))))
- ;; TODO multiple hits
- ;; TODO feedback when hsinspect is broken
- (popup-tip (format "%s" (cdar (last found))))))
+ (if-let* ((sym (haskell-tng--hsinspect-symbol-at-point))
+ (found (seq-find
+ (lambda (names) (member sym (seq-map #'cdr names)))
+ (haskell-tng--hsinspect-imports nil alt))))
+ ;; TODO multiple hits
+ (popup-tip (format "%s" (cdar (last found)))))
+ (user-error "Not found"))
;;;###autoload
(defun haskell-tng-import-symbol-at-point (&optional alt)
@@ -114,7 +114,7 @@ A prefix argument ensures that caches are flushes."
(insert-file-contents (expand-file-name ".ghc.flags"))
(split-string
(buffer-substring-no-properties (point-min) (point-max))))
- (user-error "could not find `.ghc.flags': add GhcFlags.Plugin and
compile.")))
+ (user-error "Could not find `.ghc.flags': add GhcFlags.Plugin and
compile.")))
(defvar-local haskell-tng--hsinspect-imports nil)
(defun haskell-tng--hsinspect-imports (&optional no-work flush-cache)
@@ -160,10 +160,11 @@ A prefix argument ensures that caches are flushes."
(let ((process-environment (cons "GHC_ENVIRONMENT=-"
process-environment)))
(apply
#'call-process
- (haskell-tng--hsinspect-exe flush-cache)
+ (or (haskell-tng--hsinspect-exe flush-cache)
+ (user-error "Could not find hsinspect: add to
build-tool-depends"))
nil "*hsinspect*" nil
(append params '("--") ghcflags))))
- (user-error "`hsinspect' failed. See the *hsinspect* buffer for more
information")
+ (user-error "Failed, see *hsinspect* buffer for more information")
(with-current-buffer "*hsinspect*"
;; TODO remove this resilience against stdout / stderr noise
(goto-char (point-max))
- [nongnu] elpa/haskell-tng-mode be4cc15 238/385: better hsinspect command, (continued)
- [nongnu] elpa/haskell-tng-mode be4cc15 238/385: better hsinspect command, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 73ba85d 270/385: nicer indentation for single parameter type sigs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 19c03cc 254/385: company-mode shouldn't force an hsinspect call, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a947ef0 249/385: support for projects with custom Setup.hs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dc7aabf 281/385: popup tooltips, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fb9174d 292/385: removing popup is futile, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 1b4bf3b 294/385: improve the cabal defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode b2cd1c8 297/385: projectile-tags-command should be buffer local, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7b45c25 298/385: guard file saving, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e245a93 296/385: allow opt-out of local history, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 411268e 310/385: improve hsinspect error messages,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 766480d 290/385: fast-tags should be project specific, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode efd8093 299/385: silent formatter errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 26c6828 291/385: fqn imports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4480bb4 319/385: bump hsinspect/ghcflags versions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 99287ef 316/385: stack projectile defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from instead of catch / throw, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d611f0b 322/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a717a50 331/385: allow workflow with qualified imports as default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even smarter, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5a064fd 328/385: hypen prefix asks to qualify the import, ELPA Syncer, 2021/10/06