Comments (9)
Check if you can call ghc-mod from command line in root of your Haskell project
from intellij-haskell.
Thank you for your reply,I have tried this ghc-mod command in root of my project
pzwus-imac:yesodtest pzwu$ /Users/pzwu/.cabal/bin/ghc-mod info /Users/pzwu/outwork/haskell/yesodtest/app/Main.hs someFunc
and I got this, does that mean my ghc-mod configuration is correct?
someFunc :: IO () -- Defined at src/Lib.hs:6:1
from intellij-haskell.
Yes, can you also try to run:
ghc-mod legacy-interactive
in root of your Haskell project.
from intellij-haskell.
I think I am having the same problem.
My config is:
ghc-mod: /Users/marc/Library/Haskell/bin/ghc-mod
haskell-docs: /Users/marc/Library/Haskell/bin/haskell-docs
hlint: /Users/marc/Library/Haskell/bin/hlint
cabal: /Users/marc/Library/Haskell/bin/cabal
I have a simple file:
main :: IO ()
main = putStrLn "hello world!"
When I open it, I get these errors in my intellij:
8:03:06 PM Shutting down ghc-mod for project fbm-shirt.
8:03:06 PM Error while shutting down ghc-mod for project fbm-shirt. Error message: Stream closed
8:03:08 PM Starting ghc-mod in interactive mode for project fbm-shirt.
8:03:13 PM Error in communication with ghc-mod: Futures timed out after [5 seconds]. Check if GHC SDK is set and ghc-mod is okay. ghc-mod will not be called for 5 seconds. Command was: check /Users/marc/side_projects/fbm-shirt/app/Main.hs
8:03:18 PM Error in communication with ghc-mod: Stream closed. Check if GHC SDK is set and ghc-mod is okay. ghc-mod will not be called for 5 seconds. Command was: info /Users/marc/side_projects/fbm-shirt/app/Main.hs main
8:03:37 PM Error in communication with ghc-mod: Stream closed. Check if GHC SDK is set and ghc-mod is okay. ghc-mod will not be called for 5 seconds. Command was: info /Users/marc/side_projects/fbm-shirt/app/Main.hs main
I can run these commands in the root directory of my project:
➜ fbm-shirt ghc-mod info /Users/marc/side_projects/fbm-shirt/app/Main.hs main
main :: IO () -- Defined at app/Main.hs:2:1
➜ fbm-shirt
And I can also do it with ghc-mod legacy-interactive
:
➜ fbm-shirt ghc-mod legacy-interactive
info /Users/marc/side_projects/fbm-shirt/app/Main.hs main
main :: IO () -- Defined at app/Main.hs:2:1
OK
from intellij-haskell.
@ParkinWu @marcgrr Do you use OSX?
from intellij-haskell.
I do use OSX. I think I have just fixed mine by building the plugin from the latest commit on master! Perhaps one of the latest commits fixes something.
Thanks!!
from intellij-haskell.
Yes, I just fixed a problem especially for OSX. PATH has to passed explicitly when running command line programs from IntelliJ
from intellij-haskell.
Btw, Cabal is replaced by Stack on master
Also important if you want to download all used packages its source code.
from intellij-haskell.
Should be fixed in latest release
from intellij-haskell.
Related Issues (20)
- Element: class intellij.haskell.HaskellFile #Haskell because: Monads.hs (invalid) is invalid
- Hoogle failed database generation causes documentation to be unavailable
- Refactor (rename) type name changes data constructor name, too
- Refactor-rename doesn't change occurences in other modules HOT 1
- "Add <someDataConstructor> to import list" doesn't work correctly
- HLint "Redundant <x>" suggestions often create garbled code HOT 2
- How do I set my project to use stack install on wsl2. Didn't find any doc about it.
- Creating a new project without Haskell installed fails HOT 3
- Plugin doesn't signal syntax errors HOT 1
- Why is plugin falling back on lts 18? HOT 2
- REPL does not start with IntelliJ IDEA 2022.2.1 HOT 2
- Error when creating new project
- Pipe symbol appears italic in guards
- Support post-qualified imports
- Inconsistent indentation after newline?
- New project error. HOT 1
- Intellij spellcheck issue
- How do I ignore my .ghci file to get rid of the error: [global-stack-repl] No result from REPL within 60 seconds. Command was: :load HOT 1
- Exception in plugin 1.0.0-beta88: "No display name specified in plugin descriptor XML file for configurable" HOT 3
- REPL couldn't be started for target
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intellij-haskell.