laughedelic / atom-ide-scala

:atom: Scala & Dotty support for Atom IDE (🧟‍♂️ zombie repo)
https://atom.io/packages/ide-scala
MIT License
48 stars 10 forks source link

Parse .ensime to launch Ensime server #64

Closed laughedelic closed 6 years ago

laughedelic commented 6 years ago

This is a follow-up of #3 and should fix #13.

In the end I didn't use ensime-lsp-client, because

Most likely it's heavy because of the fastparse dependency, which is used to parse S-expressions. I don't see much point in writing a custom parser for it if you can reuse an existing node package. (I understand the general idea of having a self-contained Scala.js reusable part, but in this particular situation it's not a good solution)

Also there are a lot of little warts in the code of ensime-lsp-client that I would simplify/refactor/remove, but I don't want to rewrite it, if I'm not going to use it anyway (again, because of fastparse).

So in the end I used fwg/s-expression for parsing .ensime. With the added facade and implementation it's +60KB to the resulting JS 🙆‍♂️

laughedelic commented 6 years ago

Tested with the fix for the ensime-server: https://github.com/ensime/ensime-server/pull/1945 and results are not very different from what I observed in https://github.com/laughedelic/atom-ide-scala/pull/3#issuecomment-345897287 using coursier to launch the server (without reading .ensime). Anyway, I hope that proper classpath setting makes it work better.