These are chat archives for carymrobbins/intellij-haskforce

6th
Jan 2018
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:01
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
@i-am-the-slime you mean like auto-import?
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:16
Yes
Like alt-tab and then import the type under the point
Cary Robbins
@carymrobbins
Jan 06 2018 22:20
@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
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
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
Okay, that's actually what I use everyday so that's a win.
Cary Robbins
@carymrobbins
Jan 06 2018 22:25
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
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
GHC Haskell
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:26
I've heard of Eta, but I haven't tried it (nor Frege).
Cary Robbins
@carymrobbins
Jan 06 2018 22:26
Nah it's not bad, and i can help all through the way
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:26
That would be exciting.
Cary Robbins
@carymrobbins
Jan 06 2018 22:27
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
I can imagine.
Cary Robbins
@carymrobbins
Jan 06 2018 22:28
Do you use ghc-mod with HaskForce?
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:29
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
Hmm yeah are you using stack?
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:30
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
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
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
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
this is without the "nix-integration" I supose
Cary Robbins
@carymrobbins
Jan 06 2018 22:36
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
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
Ahhh ok
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:38
HaskForce would not find any ghc-mod automatically though
Cary Robbins
@carymrobbins
Jan 06 2018 22:38
So for auto-import, ghc-mod has a find command
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:38
so I just installed it globally and that seems to have worked
Okay
Cary Robbins
@carymrobbins
Jan 06 2018 22:38
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
Uh okay.
Where is the HaskForce config?
Cary Robbins
@carymrobbins
Jan 06 2018 22:39
I know... it's not great.
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:40
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
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
/home/mark/.nix-profile/bin/ghc-mod
that's what's there currently
Cary Robbins
@carymrobbins
Jan 06 2018 22:44
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
Yup, I will remember that, and worry about it when it bites me.
Cary Robbins
@carymrobbins
Jan 06 2018 22:44
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
It just works
does some compiling before but it works
Cary Robbins
@carymrobbins
Jan 06 2018 22:47
Oh so i forgot, but the GhcModi class is still java
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:48
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
Heh nah it's fine
Mark Eibes
@i-am-the-slime
Jan 06 2018 22:49
should ghc-mod also find stuff from the current code base?
Cary Robbins
@carymrobbins
Jan 06 2018 22:49
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
that's cool
Mark Eibes
@i-am-the-slime
Jan 06 2018 23:01
I will have a look during the course of the week and bother you with questions
Cary Robbins
@carymrobbins
Jan 06 2018 23:04
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
that sounds good!