These are chat archives for ensime/ensime-atom

21st
May 2016
Felix Becker
@felixfbecker
May 21 2016 12:11
Hi, I'm trying to use https://github.com/ensime/ensime-node to implement the VS Code ensime extension, but noticed that Client for example is still implemented in CoffeeScript and therefor typed any. I'm trying to refactor but I'm unsure about the types. @hedefalk do you plan to rewrite this in TS?
Viktor Hedefalk
@hedefalk
May 21 2016 13:37
@felixfbecker Yes, my plan is to refactor ensime-client to be typed. However, I've been trying to move in small steps as to not have to break or handle multiple forks for ensime-client/ensime-atom/ensime-vscode. I'd love to get contributions so I promise to push all I have tonight as stated in other thread. Main point though is that if a api breaking change is done in ensime-client to serve ensime-vscode, ensime-atom has to get the fix pretty much immediately too. And in all that I started working on fixing up som real test coverage and than I ran out of time :)
But I'm thrilled there's interest from someone who has already done vscode packages! I think I could step down from that and just try to work on ensime-client to be a great lib for both Atom and vscode.
I think best way is to move as much as possible to ensime-client that is not Atom or vscode specific. Currently, the code is in some weird in-between stage where separation of concerns is not very clear. I'd like to clean that up in ensime-client.
Felix Becker
@felixfbecker
May 21 2016 15:45
@hedefalk Looking through the code I also noticed a couple of things that should be improved:
  • Use of sync IO functions should be avoided because the module is used in editor plugins, this might block the whole editor
  • More promises, less callbacks
  • in the client there is an instance of if (err) throw err which would crash the process
I will wait for you to rewrite to TS because I don't know CoffeeScript :D
Viktor Hedefalk
@hedefalk
May 21 2016 19:39

@felixfbecker Yup, agree with it all. I think I "convenienced" to use sync versions only on a few one-time io operations for startup. I basically just used the node way of callbacks on the last argument, but I also like promises better so it's in the pipeline. It's pretty easy to do "promisify" on any function that has a callback as last arg though, like http://bluebirdjs.com/docs/api/promise.promisify.html that I think I've used in ensime-atom.

That throw seems pretty bad, gotta be copy and paste :)