[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode 949f857 242/385: support component direct
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode 949f857 242/385: support component directories |
Date: |
Tue, 5 Oct 2021 23:59:39 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit 949f857074aaaf655e10491d7cb94ed4b2138e6c
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
support component directories
---
cabal-ghcflags.sh | 11 ++++++++---
haskell-tng-hsinspect.el | 5 ++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/cabal-ghcflags.sh b/cabal-ghcflags.sh
index ca08e25..138bc4d 100755
--- a/cabal-ghcflags.sh
+++ b/cabal-ghcflags.sh
@@ -55,11 +55,16 @@ jq -c '(.["install-plan"][] | select(.["pkg-src"].type ==
"local") | select(.["c
COMPONENT="$PART"
fi
- CACHE=$(echo "$ROOT/.ghc.flags.$PART" | sed 's/:/./g')
- echo "creating $CACHE"
rm "$TMP/out" 2> /dev/null
cabal v2-repl -v0 -w "$TMP/ghc" "$NAME:$COMPONENT"
- cat "$TMP/out" > "$CACHE"
+
+ # extract all the source directories that use these flags
+ for D in $(cat "$TMP/out" | tr ' ' '\n' | grep '^-i' | sed 's/^-i//' | sed
'/^$/d') ; do
+ if [ -d "$D" ] ; then
+ echo "writing $D/.ghc.flags"
+ cat "$TMP/out" > "$D/.ghc.flags"
+ fi
+ done
done
if [ -d "$TMP" ] ; then
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 3600d6b..5d04250 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -55,14 +55,13 @@ change."
(defun haskell-tng--hsinspect-ghcflags ()
;; https://github.com/haskell/cabal/issues/6203
"Obtain the ghc flags for the current buffer"
- (if-let (cache (locate-dominating-file default-directory ".ghc.flags.lib"))
+ (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
- ;; FIXME support exe/test/etc components (discover the component)
- (insert-file-contents (expand-file-name ".ghc.flags.lib" cache))
+ (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.lib'. Run `M-x
haskell-tng-hsinspect'")))
- [nongnu] elpa/haskell-tng-mode 950d094 210/385: projectile is not core, (continued)
- [nongnu] elpa/haskell-tng-mode 950d094 210/385: projectile is not core, ELPA Syncer, 2021/10/06
- [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 <=
- [nongnu] elpa/haskell-tng-mode 7ae3f46 244/385: more workarounds for hsinspect setup, ELPA Syncer, 2021/10/06
- [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