nboldi / haskell-tools-atom

An Atom editor binding for the Haskell-tools framework
7 stars 2 forks source link

Support wider range of ht-daemon versions #42

Open sniperrifle2004 opened 6 years ago

sniperrifle2004 commented 6 years ago

Currently this package follows the ht-daemon version quite strictly. While this is acceptable in the haskell eco system, the atom plugin is NOT a part of this eco system. I should be able to use the atom plugin with a wider range of environments than just the most recent one.

nboldi commented 6 years ago

The strict relation between the atom plugin and the server currently exists because in this early stage of development, the protocol between them changed several times. After it stabilizes I plan to allow a wider range of versions to work with the client.

steshaw commented 6 years ago

I tried and failed to get haskell-tools working in Atom (and Atom-Beta). I first tried installing with stack and resolver lts-10.2. I get an error in Atom:

The server version is not compatible with the client version. For this client the server version must be at >= 1,0,0,0 and < 1,1,0,0. You should probably update both the client and the server to the latest versions.

IIRC, at the time I was running version 1.0.0.2 of haskell-tools:

$ ht-daemon --version
1.0.0.2

I realised that I hadn't followed the installation instructions for haskell-tools to the letter so I reinstalled using a nightly resolver:

$ stack install haskell-tools-daemon haskell-tools-cli --resolver=nightly

This installs version 1.0.0.3 of haskell-tools:

$ ht-daemon --version
1.0.0.3

Unfortunately, I get the same error as above from Atom.

I seem to be running 1.0.0 of the Atom haskell-tools plugin:

$ apm show haskell-tools
haskell-tools
├── 1.0.0
├── https://github.com/nboldi/haskell-tools-atom
├── A binding for the Haskell-tools framework
├── 492 downloads
└── 0 stars

Run `apm install haskell-tools` to install this package.

As an aside, I was able to use ht-refact from the command line to organise imports in my project. Is there anything I can try to get this working in Atom? Any progress on a Spacemacs/Emacs plugin. I really like Atom but I tend to use Spacemacs atm because of it's great Intero support.

nboldi commented 6 years ago

There was an error in how the versions were compared, but it is fixed in the 1.1.0 version of the Atom haskell-tools plugin. Thank you for the feedback!

steshaw commented 6 years ago

Excellent, thanks! I updated the Atom plugin to 1.1.0 and it works 🎉!