intellij-haskforce
intellij-haskforce copied to clipboard
Type info menu option doesn't work
Hello,
Supose I have a map function like this : map (/x -> x * 2) l is there a way I can see the type of x then ?
Regards,
Roelof
I made a test file
test =
test l = concat $ map (\x -> case of Nothig; case Just v -> [v] ) l
When I select for example the v and choose for view -> tyoe info, I do not see anything. Also I see no type definition error as the demo on the page is showing.
Roelof
@rwobben - The Type Info feature is enabled by configuring ghc-mod and ghc-modi in Haskell Tools under your project settings. Have you configured those? If not, please see the Quick Start Guide on configuring external tools.
yep, on all those things something is filled in.
I did all the steps again and see now this error message :
ghc failed to create process for command '''' --numeric version caused by : com.intelij.execution.ExecutionException : executable is not specifed Configure
But everything is filled in. See here : http://snag.gy/U6vWg.jpg .
That error appears to be from ghc
. In your project settings, check Build, Execution, Deployment > Compiler > Haskell Compiler, ensure you are configured to build with either Stack or Cabal and that the appropriate paths are properly set. I would recommend using Stack if possible.
How did you create the project? This should all be taken care of for you during the project wizard.
Oke,
i made a new project with new -> project put it the same file :
Module Test where
myTest = concat $ map $ ( \x -> case x of Nothing -> [] ; Just v -> [v] )
But when select something like the v and choose view -> type-info I see no info at all.
Hopefully either today or tomorrow I'll make a release with the new Haskell Tools Console (see #237) which displays the commands sent to and output from external tools like ghc-mod. Once that's released it should be easier to tell what's going on here.
Took a little longer than I expected, but v0.3-beta.30 is out, and includes the Haskell Tools Console. When you get a chance, try to reproduce the issue and check the ghc-modi console. If you can paste the log somewhere and link it here that should help in determining the cause of the issue.
Thanks, can I upgrade within Intelij or do I have to download a whole new copy.
You should be able to download from within IntelliJ by using Help > Check for Updates.
I see now output but confusing output.
I have this code:
gameWords :: IO WordList
gameWords = do
aw <- allWords
return (filter gameLength aw)
where gameLength w =
let l = length (w :: String)
in l > minWordLength && l < maxWordLength
Now I hightlight the l in the line let l = length (w:String) and see this output :
37 15 37 39 "Int"
37 11 38 52 "Bool"
36 9 38 52 "String -> Bool"
33 1 38 52 "IO Wordlist"
I only asked for the type of l and not for the rest.
Now I hightlight the l in the line let l = length (w:String)
Maybe try to just place you cursor over the variable you want and press Alt+= (or whatever the keybinding is for your platform).
Speaking of, what OS are you using?
Also, this may not be related, but the indentation seems a little off in the definition of gameWords
and would probably result in a parse error. I'd try something like this -
gameWords :: IO WordList
gameWords = do
aw <- allWords
return (filter gameLength aw)
where
gameLength w =
let l = length (w :: String)
in l > minWordLength && l < maxWordLength
Thanks,
When I place my cursor over the variable and oress alt + = then I see a little screen that contains the type info. When I do the same and choose View -> Type info I do not see any output but I see output in the ghc-modi screen.
I use now Manjaro Linux as platform.
I'm not sure why this is happening, I've opened a discussion about the implementation details on the IntelliJ Development Form.
Note that this same issue occurs in the Scala plugin also.