[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 7ae3f46 244/385: more workarounds for hsi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 7ae3f46 244/385: more workarounds for hsinspect setup |
Date: |
Tue, 5 Oct 2021 23:59:40 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 7ae3f46d6387eca3db268116e3d6492124ffb91b
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
more workarounds for hsinspect setup
---
README.md | 9 ++++++++-
cabal-ghcflags.sh | 3 +++
haskell-tng-hsinspect.el | 14 +++++---------
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 97567e8..026f8e1 100644
--- a/README.md
+++ b/README.md
@@ -64,10 +64,17 @@ You must install `hsinspect` for every version of `ghc`
that you plan to use, e.
rm -f ~/.cabal/bin/hsinspect
for V in 8.4.4 8.6.5 ; do
cabal v2-install hsinspect -w ghc-$V &&
- mv ~/.cabal/bin/hsinspect ~/.cabal/bin/hsinspect-ghc-$V
+ mv -f ~/.cabal/bin/hsinspect ~/.cabal/bin/hsinspect-ghc-$V
done
```
+<!--
+for V in 8.4.4 8.6.5 ; do
+ cabal v2-install exe:hsinspect -w ghc-$V &&
+ mv -f ~/.cabal/bin/hsinspect ~/.cabal/bin/hsinspect-ghc-$V
+done
+-->
+
To use `hsinspect` commands, generate `.ghc.flags` / `.ghc.version` files by
running `M-x haskell-tng-hsinspect` for a project. This is only needed when the
dependencies change.
`hsinspect` only works when the dependencies of the current file have been
compiled (the current file doesn't need to be compilable).
diff --git a/cabal-ghcflags.sh b/cabal-ghcflags.sh
index cb7e78b..fed1132 100755
--- a/cabal-ghcflags.sh
+++ b/cabal-ghcflags.sh
@@ -76,6 +76,9 @@ jq -c '(.["install-plan"][] | select(.["pkg-src"].type ==
"local") | select(.["c
rm "$OUTPUT" 2> /dev/null || true
cabal v2-repl -v0 -w "$TMP/ghc" "$NAME:$COMPONENT"
+ # TODO also need to provide the PATH, since it might include commands that
+ # are referred to from compiler plugins (e.g. tasty-discover).
+
# extract all the source directories that use these flags
for D in $(cat "$OUTPUT" | tr ' ' '\n' | grep '^-i' | sed 's/^-i//' | sed
'/^$/d') ; do
if [[ "$D" != /* ]] ; then
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index b06f013..435987d 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -58,14 +58,10 @@ change."
;; https://github.com/haskell/cabal/issues/6203
"Obtain the ghc flags for the current buffer"
(if-let (default-directory (locate-dominating-file default-directory
".ghc.flags"))
- (seq-map
- ;; hsinspect works best if we trick the compiler into thinking that the
- ;; file we are inspecting is independent of the current unit.
- (lambda (e) (if (equal e "-this-unit-id") "-package-id" e))
- (with-temp-buffer
- (insert-file-contents (expand-file-name ".ghc.flags"))
- (split-string
- (buffer-substring-no-properties (point-min) (point-max)))))
+ (with-temp-buffer
+ (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'. Run `M-x
haskell-tng-hsinspect'")))
(defun haskell-tng--hsinspect-ghc ()
@@ -102,7 +98,7 @@ t means the process failed.")
(haskell-tng--hsinspect-ghc)
nil "*hsinspect*" nil
;; need to disable all warnings
- (append `("imports" ,buffer-file-name "--") ghcflags
'("-w")))))
+ (append `("imports" ,buffer-file-name "--") ghcflags))))
(user-error "`hsinspect' failed. See the *hsinspect* buffer for more
information")
(setq haskell-tng--hsinspect-imports
(with-current-buffer "*hsinspect*"
- [nongnu] elpa/haskell-tng-mode 2df165a 229/385: electric indent locally disabled only, (continued)
- [nongnu] elpa/haskell-tng-mode 2df165a 229/385: electric indent locally disabled only, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 56ee2aa 231/385: completions alpha, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6e938d0 230/385: workaround cabal bug, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 444664d 257/385: special case indentation of visual line breaks, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 487989b 241/385: skeleton for contrib-stack, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode cea8b23 240/385: proof of concept getting the ghcflags from cabal, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6699829 277/385: cleaner fqns, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0abe075 246/385: only create ghcflags for relative dirs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 2cfae9e 276/385: bump hsinspect, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 949f857 242/385: support component directories, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 7ae3f46 244/385: more workarounds for hsinspect setup,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 494aef4 302/385: cache the results of hsinspect imports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 598b372 288/385: typo, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode e0fd8f4 303/385: abstract the hsinspect caching logic, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4dc6f76 313/385: fix hsinspect discoverability, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode eb4591f 287/385: document popup dependency, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 48729c8 308/385: more cache cleanups, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 6299e6d 317/385: amazeballs idea, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode aa9cdbb 226/385: hacky file-specific language extensions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a4f06f5 237/385: an idea, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 0113f37 273/385: hsinspect should work on symbols with FQNs, ELPA Syncer, 2021/10/06