These are chat archives for ensime/ensime-atom

27th
Jun 2015
Rik
@mrmechko
Jun 27 2015 02:14
ohai
Arnout Engelen
@raboof
Jun 27 2015 09:42
is there a nice overview of the different scala packages in atom.io somewhere?
Viktor Hedefalk
@hedefalk
Jun 27 2015 10:12
@mrmechko Welcome! @raboof Not sure, haven't seen any. Would be nice to know what they all are.
Arnout Engelen
@raboof
Jun 27 2015 10:19
didn't find anything, will write something up myself
Viktor Hedefalk
@hedefalk
Jun 27 2015 11:10
@raboof Awesome! I haven't taken the time to look myself so please share when you've tried some of them. language-scala was there when I started this thing, but the other ones I believe are newer.
Arnout Engelen
@raboof
Jun 27 2015 11:50
hmm, I now don't get any autocompletions anymore after loading ensime - not even the ones I do get when ensime is not loaded
any idea where to look for what's wrong?
Viktor Hedefalk
@hedefalk
Jun 27 2015 13:04
@raboof Did you uninstall autocomplete+?
Arnout Engelen
@raboof
Jun 27 2015 13:14
nope - also it actually works in another project
Viktor Hedefalk
@hedefalk
Jun 27 2015 13:46
Try doing typecheck-all. But if you don't get any at all, that's super weird. could you open the dev tools and check for js errors?
Arnout Engelen
@raboof
Jun 27 2015 13:56
no js errors - the typecheck-all does return an ensime error though ('exception during macro expansion: scala.reflect.macros.TypecheckException: macro method materializeTypeTag in package api cannot be accessed in object scala.reflect.api.package')
Viktor Hedefalk
@hedefalk
Jun 27 2015 14:33
weird. I don't think that the ensime package could destroy autocomplete totally…
Arnout Engelen
@raboof
Jun 27 2015 15:21
would it be a bad idea to suggest users to use ctags to pick up the sources in .ensime_cache/dep-src? at least as long as we don't have 'search definition' via ensime yet
there's also 2 different sbt-ctags plugins but invoking ctags seems simpler
Arnout Engelen
@raboof
Jun 27 2015 15:41
OK, I did a small write-up of what I've learned so far at http://blog.xebia.com/2015/06/27/scala-development-with-githubs-atom-editor/
Feedback welcome, will keep it updated as I learn more :).
Gotta go now though, talk to you later!
Viktor Hedefalk
@hedefalk
Jun 27 2015 17:51
Cool, thanks! Interesting with ctags, do you think it would be possible to programmatically give data from Ensime to that package?
I want to make sure that the ensime plugin plays nicely with other packages and adds functionality, but doesn't break the other stuff so that you can fall back to it sometimes. I think it would be nice to try to use as much as possible from the atom community and not rewrite everything.
Rik
@mrmechko
Jun 27 2015 18:57
@hedefalk you mentioned something about writing the plugin in Scalajs
Would that entail mapping the atom api to scalajs?
Viktor Hedefalk
@hedefalk
Jun 27 2015 20:03
@mrmechko Yes.
Rik
@mrmechko
Jun 27 2015 20:04
I don’t know much about scalajs or the atom api but i’d be up for working on that
Viktor Hedefalk
@hedefalk
Jun 27 2015 20:04
That'd be awesome! I think it's pretty straightforward and you might get bored 'cause I guess there will be a bit of grunt work. But I'd be super happy if I didn't have to do it all myself :)
However, I must state that a conversion to scala.js is not really super-top-priority for me. I want more features first which feels like lower fruit right now. I really want to be able to work in Atom instead of having Idea at the side. That basically entails making code nav really work, and implicits, and go to type. So those are the first things I will work on.
Rik
@mrmechko
Jun 27 2015 20:07
Can you set up something like waffle.io for the project
Viktor Hedefalk
@hedefalk
Jun 27 2015 20:07
But anyways, I'd be super grateful if you worked on that! I think you basically just write traits for everything.
Rik
@mrmechko
Jun 27 2015 20:08
Yeah if you just give me a project structure I’ll work on it in my spare time
unfortunately I really don’t even know whare to start with scalajs libraries.
Viktor Hedefalk
@hedefalk
Jun 27 2015 20:13
Sure! It might be a couple of days before I can do that, really choked right now. I guess it atom-scalajs should be a separate project, but if you want me to set it up, I'll do that. So we need: 1) atom-scalajs - a standalone scala sbt project that typesets (!) atom api. 2) add an sbt build step to ensime-atom that compiles scala to js that is packaged up by apm. 3). leave maybe just one file of js/coffescript that bootstraps the scala.js - actually maybe we don't even need that, but I think it will be easier.
I'm already working on it!
Got inspired!
Rik
@mrmechko
Jun 27 2015 20:18
sweet! just let me know when I can be helpful!
Viktor Hedefalk
@hedefalk
Jun 27 2015 20:28
Awesome! Really nice that you're joining in!
I'm going to try to set something up. I realize there is a lot more than just atom's api's though. atom is basically node and I've been using a few of those api's as well (fs, net and more)
Viktor Hedefalk
@hedefalk
Jun 27 2015 20:35
But I think it is a fun venture to see how hard it is to gradually introduce it. I watched Richard's talk over here: https://www.parleys.com/tutorial/towards-browser-server-utopia-scala-js-example-using-crdts and he states that it is highly possible to introduce it gradually.
Rik
@mrmechko
Jun 27 2015 20:38
ok I’ll watch that when I get a chance.
Rik
@mrmechko
Jun 27 2015 20:54
btw, the other thing that I think would be necessary eventually is looking into sbt-server or whatever it is. This isn’t directly related to ensime, but if atom is going to be a full fledged api, then we need to be able to run sbt tasks from inside atom —> sbt server allows a single instance of sbt to run in the background serving multiple projects (I believe).
Although, sbt-atom is a separate project altogether, methinks :-p
Viktor Hedefalk
@hedefalk
Jun 27 2015 21:34
I've been trying to understand what sbt-server is about and if it is already usable, but haven't been able to find something easily digested online. Just some activator stuff. I saw Josh Suereth and Eugene Dakota talk about it in scaladays and I've heard it mentioned a few times even long ago. What I understand is that it could be the underlying thing serving for instance multiple IDE:s simultaneously. So you fire up sbt-server on a project and then you can run Eclipse, idea and Ensime as clients. So I believe that ensime-server could then maybe talk to sbt-server instead of directly to presentation compiler, but ensime adds more than this. However, I leave this to the big boys like @fommel and @rorygraves. I just wanna hack some GUI right now to get rid of those bloated IDE:s in my day job once and for all :)
Some kind of shell to start writing out atom api:s https://github.com/hedefalk/scala-js-atom
Gotta go to bed now!
Rik
@mrmechko
Jun 27 2015 21:35
Good night! I’ll take a look at it and see if I can understand what needs to be done
Viktor Hedefalk
@hedefalk
Jun 27 2015 21:38
I'm to lazy to write more than a few methods up front - those kind of things need to be outside-in for me, I'll add the api when I need it. So I would like to get something up in atom first before I put any more effort in doing the interface. I think we could do a branch of ensime-atom right now that adds a build.sbt and try to wrestle it in to the atom way. What we need I think is hooking in to apm (maybe) and run sbt as a pre-buildstep. I guess it's all very doable, but I want it real nice so it doesn't slow us down at all.
We need to see how to use node.js modules from scala.js. I guess it would be a normal use case. But if you have to go full Dynamic then I can't see any point. But I think you can write require-clauses with types added. But then again, I think we will need to write quite a few node.js module facades as well :) If only time was unlimited.
Viktor Hedefalk
@hedefalk
Jun 27 2015 21:58
@raboof Can you tell me a bit more about ctags? How do you use this: https://gist.github.com/raboof/22dd53899b7893fc9192 I just posted this: atom/symbols-view#109
Viktor Hedefalk
@hedefalk
Jun 27 2015 23:04
Couldn't help myself. Just published formatting feature.
Low fruit. hedefalk/ensime-atom@33b9661
However, couldn't get markers to work so cursor position had to be retained by just coordinates. So if formatting does new line breaks you will get irritated. But think that's unusual or probably not ever happening?