Skip to content

Conversation

jappeace
Copy link

Obviously it allows the insertion of a custom hoogle command. I now have this server running in a nix-shell per project:

(use-package haskell-mode
  :config
  (custom-set-variables
   ...
   '(haskell-hoogle-command (concat (projectile-project-root) "scripts/hoogle.sh"))
   )
...
)

and that hoogle script:

#! /bin/sh
set -x 

# https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ARGS="$@"

nix-shell --run "hoogle $ARGS" $DIR/../shell.nix 
exit 0

It would be slightly more convenient to have this command be a function so it can always return the most recent (projectile-project-root), and do the argument juggling inside lisp instead of a custom script.
But this works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant