Closed stevemacn closed 9 years ago
ac-haskell requires haskell-ghc-mod to browse modules for symbols and get types. So, you do need to get ghc-mod working first. To get it working, you could put full path to ghc-mod/ghc-modi into haskell-ghc-mod settings.
Thank you! Yes I realized that last night. The problem I keep running into is that atom won't take my system path from .zshrc. So when I explicitly point it to ghc-mod ghc-modi it can't find cabal. It is a mess. I think my problem isn't specific to your plugin after all. Thank you for the quick response!
You could try running Atom through env, like so
env PATH=... atom
Not sure if it helps much, since I'm not sure what's the root of your problem in the first place, but worth a try.
You could also hack relevant PATH into your atom startup script (which atom
or something like that should show full path to it), which isn't pretty, but will most likely work.
Awesome, I hacked the startup and injected my path from there. Now autocomplete is working amazingly - showing types and all. The only issue I have now is that occasionally this error to pop up. It doesn't seem tied to any specific commands that I am using. It appears to potentially be tied to command + s (save).
Atom Version: 0.179.0 System: Mac OS X 10.10.2 Thrown From: haskell-ghc-mod package, v0.4.1
Uncaught Error: Error: Command failed: /Users/stevemacneil/Libraries/haskell/ghc-mod/dist/build/ghc-mod/ghc-mod check /var/folders/xz/c_6780rs4sn5y78ynybxb5kr0000gn/T/haskell-ghc-mod115112-77912-iiu9f9.hs
launching operating system process cabal configure
failed: cabal configure (exit 1)
cabal: At least the following dependencies are missing:
base ==4.6.*
At /Users/stevemacneil/.atom/packages/haskell-ghc-mod/lib/ghc-modi-process.coffee:69
Error: Error: Command failed: /Users/stevemacneil/Libraries/haskell/ghc-mod/dist/build/ghc-mod/ghc-mod check /var/folders/xz/c_6780rs4sn5y78ynybxb5kr0000gn/T/haskell-ghc-mod115112-77912-iiu9f9.hs
launching operating system process `cabal configure` failed: cabal configure (exit 1)
cabal: At least the following dependencies are missing:
base ==4.6.*
at /Users/stevemacneil/.atom/packages/haskell-ghc-mod/lib/ghc-modi-process.coffee:69:17
at ChildProcess.exithandler (child_process.js:756:5)
at ChildProcess.emit (events.js:119:17)
at maybeClose (child_process.js:1013:16)
at Socket.<anonymous> (child_process.js:1181:11)
at Socket.emit (events.js:116:17)
at Pipe.close (net.js:477:12)
-2:11.6 core:move-up (atom-text-editor.editor.is-focused.autocomplete-active)
12x -2:09.5 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
2x -2:00.7 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
2x -0:58.5 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
3x -0:43.4 core:move-up (atom-text-editor.editor.is-focused.autocomplete-active)
3x -0:42.8 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
8x -0:42.1 core:move-down (atom-text-editor.editor.is-focused.autocomplete-active)
5x -0:40.6 core:move-up (atom-text-editor.editor.is-focused.autocomplete-active)
-0:39.2 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
-0:38.4 core:move-up (atom-text-editor.editor.is-focused.autocomplete-active)
25x -0:36.5 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
3x -0:15.4 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
2x -0:07.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
2x -0:06.6 core:move-up (atom-text-editor.editor.is-focused.autocomplete-active)
9x -0:05.7 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
-0:02.1 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
{
"core": {
"themes": [
"solarized-dark-ui",
"solarized-dark-syntax"
],
"disabledPackages": [
"Zen",
"linter-hlint"
]
},
"haskell-ghc-mod": {
"ghcModPath": "/Users/stevemacneil/Libraries/haskell/ghc-mod/dist/build/ghc-mod/ghc-mod",
"ghcModiPath": "/Users/stevemacneil/Libraries/haskell/ghc-mod/dist/build/ghc-modi/ghc-modi",
"enableGhcModi": false
}
}
# User
autocomplete-haskell, v0.2.0
autocomplete-plus, v2.1.5
dash, v1.0.2
haskell-ghc-mod, v0.4.1
ide-haskell, v0.3.1
language-cmake, v0.1.1
language-haskell, v1.0.0
language-latex, v0.4.1
latex, v0.18.1
linter, v0.11.1
linter-clang, v2.25.1
linter-pylint, v0.2.0
script, v2.16.0
solarized-dark-ui, v0.3.0
travis-ci-status, v0.11.2
Seems like your cabal project is misconfigured. Does running cabal configure
in your project directory work?
If you just want to use autocomplete though, you might want to uncheck "Check on Save" in haskell-ghc-mod config, as this should most likely stop this error from popping up.
Awesome, thank you so much for all this help! This plugin makes life so much better!
I have it installed and have it pointing to a compiled version of hoogle. It doesn't seem to be suggesting anything though. Is there something that I missed? I noticed with your ghc-mod plugin I couldn't get it to work because atom won't recognize my path (a problem for zsh users) and consequently I can't find a way to point it to ghc-modi. Maybe there is a similar path issue here?