These are chat archives for carymrobbins/intellij-haskforce

6th
Jan 2018
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:01 UTC
Hey! Is there a way to import types or apply suggestions?
"Perhaps you want to add sample to the import list"
Cary Robbins
@carymrobbins
Jan 06 2018 22:16 UTC
@i-am-the-slime you mean like auto-import?
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:16 UTC
Yes
Like alt-tab and then import the type under the point
Cary Robbins
@carymrobbins
Jan 06 2018 22:20 UTC
@i-am-the-slime not currently, but it's something that could be done. If you or anyone else is interested, i could walk you through what it'd take to implement
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:21 UTC
I see. That would be really cool. I am still trying to figure everything out. I just came from purescript and most of this stuff works very will with purescript-ide.
Do you think it would be worth it?
What language would it have to be implemented anyway? Java?
Cary Robbins
@carymrobbins
Jan 06 2018 22:25 UTC
For sure, and ghc-mod has the ability to search for names, so we could use that.
It'd probably be easiest to use Scala
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:25 UTC
Okay, that's actually what I use everyday so that's a win.
Cary Robbins
@carymrobbins
Jan 06 2018 22:25 UTC
Me too, that's great
I'm also working on Eta support for intellij, which is essentially GHC on the JVM
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:26 UTC
Actually I am interested, but I am afraid to ask you to describe it for fear that I won't be up to the task and that I will have wasted your time.
Cary Robbins
@carymrobbins
Jan 06 2018 22:26 UTC
GHC Haskell
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:26 UTC
I've heard of Eta, but I haven't tried it (nor Frege).
Cary Robbins
@carymrobbins
Jan 06 2018 22:26 UTC
Nah it's not bad, and i can help all through the way
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:26 UTC
That would be exciting.
Cary Robbins
@carymrobbins
Jan 06 2018 22:27 UTC
It's just hard to dedicate time to all of the various things i have going on
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:27 UTC
I can imagine.
Cary Robbins
@carymrobbins
Jan 06 2018 22:28 UTC
Do you use ghc-mod with HaskForce?
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:29 UTC
Yes.
I think it's actually not the right version for my project but it still seems to work.
Cary Robbins
@carymrobbins
Jan 06 2018 22:30 UTC
Hmm yeah are you using stack?
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:30 UTC
Yes, and nixOS, and that's what's biting me.
There are about four layers of things that I don't understand :smile:
Cary Robbins
@carymrobbins
Jan 06 2018 22:31 UTC
Haha yeah
Ok so i usually just do stack build ghc-mod
Then stack exec which ghc-mod
I'd love for HaskForce to do that automagically
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:34 UTC
Does one of these need to be running?
My global ghc-mod seems to do the trick so far.
ah okay I see
Cary Robbins
@carymrobbins
Jan 06 2018 22:35 UTC
It will work if it was compiled with the same version of ghc that your project uses
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:35 UTC
this is without the "nix-integration" I supose
Cary Robbins
@carymrobbins
Jan 06 2018 22:36 UTC
Yeah i played with nix before in a vm, but don't know too much about it
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:37 UTC
nix:
  enable: true
  packages: [postgresql, haskellPackages.ghc-mod]
I have this in stack.yaml
And the postgresql thingie works, the haskellPackages.ghc-mod also goes somehwere, I guess
Cary Robbins
@carymrobbins
Jan 06 2018 22:37 UTC
Ahhh ok
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:38 UTC
HaskForce would not find any ghc-mod automatically though
Cary Robbins
@carymrobbins
Jan 06 2018 22:38 UTC
So for auto-import, ghc-mod has a find command
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:38 UTC
so I just installed it globally and that seems to have worked
Okay
Cary Robbins
@carymrobbins
Jan 06 2018 22:38 UTC
You can just use stack exec which ghc-mod and paste it into the HaskForce config
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:39 UTC
Uh okay.
Where is the HaskForce config?
Cary Robbins
@carymrobbins
Jan 06 2018 22:39 UTC
I know... it's not great.
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:40 UTC
No, I'm not complaining I'm struggling to follow :smile:
Do you mean the project settings part?
Cary Robbins
@carymrobbins
Jan 06 2018 22:40 UTC
So not a config file, in project preferences > other settings > haskell tools
Yes exactly, sorry, using gitter via a phone at the moment, so probably being overly terse
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:41 UTC
/home/mark/.nix-profile/bin/ghc-mod
that's what's there currently
Cary Robbins
@carymrobbins
Jan 06 2018 22:44 UTC
If it works, should be fine for now, just remember that if you have problems it may be due to mismatched compiler versions
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:44 UTC
Yup, I will remember that, and worry about it when it bites me.
Cary Robbins
@carymrobbins
Jan 06 2018 22:44 UTC
And you'll know how to fix
So yeah, try out ghc-mod find to test out how it works
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:46 UTC
It just works
does some compiling before but it works
Cary Robbins
@carymrobbins
Jan 06 2018 22:47 UTC
Oh so i forgot, but the GhcModi class is still java
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:48 UTC
As long as I can understand it, it should be fine. I have just never really programmed in Java, so don't expect anything idiomatic.
Cary Robbins
@carymrobbins
Jan 06 2018 22:49 UTC
Heh nah it's fine
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:49 UTC
should ghc-mod also find stuff from the current code base?
Cary Robbins
@carymrobbins
Jan 06 2018 22:49 UTC
Hmm maybe, not sure
That certainly would be nice
We also have indexing that can do that though
If ghc-mod can't
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:50 UTC
that's cool
Mark Eibes
@i-am-the-slime
Jan 06 2018 23:01 UTC
I will have a look during the course of the week and bother you with questions
Cary Robbins
@carymrobbins
Jan 06 2018 23:04 UTC
Sounds great, I can try to write up a ticket with a description of how it would work, e.g. what classes need to be implemented, how things will get wired up, etc
Mark Eibes
@i-am-the-slime
Jan 06 2018 23:04 UTC
that sounds good!