Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use haskell-hoogle-command instead of hardcoded "hoogle" #1639

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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