Skip to content

Add support for interaction with stack ghci. #746

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

Merged
merged 1 commit into from
Jul 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions haskell-customize.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Used for locating additional package data files.")
(defcustom haskell-process-type
'auto
"The inferior Haskell process type to use."
:type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-ghci))
:type '(choice (const auto) (const ghci) (const cabal-repl) (const cabal-ghci) (const stack-ghci))
:group 'haskell-interactive)

(defcustom haskell-process-wrapper-function
Expand Down Expand Up @@ -110,6 +110,12 @@ when showing type information about symbols."
:group 'haskell-interactive
:type '(choice string (repeat string)))

(defcustom haskell-process-path-stack
"stack"
"The path for starting stack."
:group 'haskell-interactive
:type '(choice string (repeat string)))

(defcustom haskell-process-args-ghci
'("-ferror-spans")
"Any arguments for starting ghci."
Expand All @@ -118,7 +124,7 @@ when showing type information about symbols."

(defcustom haskell-process-args-cabal-repl
'("--ghc-option=-ferror-spans")
"Additional arguments to for `cabal repl' invocation.
"Additional arguments for `cabal repl' invocation.
Note: The settings in `haskell-process-path-ghci' and
`haskell-process-args-ghci' are not automatically reused as `cabal repl'
currently invokes `ghc --interactive'. Use
Expand All @@ -128,6 +134,12 @@ pass additional flags to `ghc'."
:group 'haskell-interactive
:type '(repeat (string :tag "Argument")))

(defcustom haskell-process-args-stack-ghci
'("--ghc-options=-ferror-spans")
"Additional arguments for `stack ghci' invocation."
:group 'haskell-interactive
:type '(repeat (string :tag "Argument")))

(defcustom haskell-process-do-cabal-format-string
":!cd %s && %s"
"The way to run cabal comands. It takes two arguments -- the directory and the command.
Expand Down
13 changes: 12 additions & 1 deletion haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,18 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
session-name
nil)
(apply haskell-process-wrapper-function
(list (list haskell-process-path-cabal-ghci))))))))
(list (list haskell-process-path-cabal-ghci)))))
('stack-ghci
(append (list (format "Starting inferior stack GHCi process using %s" haskell-process-path-stack)
session-name
nil)
(apply haskell-process-wrapper-function
(list
(append
(list haskell-process-path-stack "ghci")
(let ((target (haskell-session-target session)))
(if target (list target) nil))
haskell-process-args-stack-ghci))))))))

(defun haskell-process-make (name)
"Make an inferior Haskell process."
Expand Down