-
Notifications
You must be signed in to change notification settings - Fork 26
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
flycheck-disable-checked not disabling haskell-stack-ghci #101
Comments
I've done the same with Every time I try to open a Haskell file, nothing happens and I see |
Thanks for reporting. Just to clarify, this project doesn't directly manage @chrissound perhaps it would make sense to disable flycheck-mode completely for Haskell files if you don't want any checking? Or maybe select the proper checker you want inside @paulyoung The error you observer seems to come from the |
This is likely what I've run into. direnv-mode (commonly used on nix) adds Then flycheck-haskell adds Theoretically that means the per project nix-shell based ghc should be picked up at the time of That leads me to believe that |
I paid more attention to my logs and found I was getting the error from this function in my messages buffer when failing:
|
Aha! I overrode the function above like so: (use-package flycheck-haskell
:config
(defun flycheck-haskell--read-configuration-with-helper (command)
(with-temp-buffer
;; Hack around call-process' limitation handling standard error
(let ((error-file (make-temp-file "flycheck-haskell-errors")))
(pcase (apply 'call-process (car command) nil (list t error-file) nil (cdr command))
(0 (delete-file error-file)
(goto-char (point-min))
(read (current-buffer)))
(retcode (insert-file-contents error-file)
(delete-file error-file)
(message "command is: \n%s" command)
(message "Reading Haskell configuration failed with exit code %s and (haxx) output:\n%s"
retcode (buffer-string))
nil)))))
:hook (haskell-mode . flycheck-haskell-setup)) And I saw it was running this:
Notice it
That means either something is wrong with the direnv code applying or somehow flycheck-haskell read configuration happens before direnv. |
For some reason the cabal file is always being preferred, even when I explicitly evaluate this in the errored state: (let ((flycheck-haskell-hpack-preference 'prefer-hpack)) (flycheck-haskell--find-config-file)) |
The error is probably due to this project using Nix for it's dependencies. And emacs is not running within the nix-context.
I've tried to disable this with either of these two options but I still run into the error (which locks up the editor for a second or two after each file save):
The text was updated successfully, but these errors were encountered: