purescript-emacs / psc-ide-emacs

Emacs integration for PureScript's psc-ide tool.
GNU General Public License v3.0
132 stars 31 forks source link

Error "Parseing the command failed. Command: {" #189

Closed goosetherumfoodle closed 4 years ago

goosetherumfoodle commented 4 years ago

I just installed psc-ide-emacs on emacs 26.3.

I have the following setup in my config file:

     (use-package purescript-mode :ensure t)
     (use-package psc-ide :ensure t)
     (add-hook 'purescript-mode-hook
       (lambda ()
     (psc-ide-mode)
     (company-mode)
     (flycheck-mode)
     (turn-on-purescript-indentation)))

When I start the server from inside a purescript buffer, the server seems to start, but then a few seconds later the minibuffer flashes the following errors:

error in process sentinel: psc-ide-unwrap-result: Error parsing Command.
error in process sentinel: Error parsing Command.

And the *psc-ide-server* buffer shows the following error:

[Error] Parsing the command failed. Command: { @(main:Command.Ide app/Command/Ide.hs:194:17)

It looks like it's just passing the server a single "{" char.

kritzcreek commented 4 years ago

I've never seen that before, that looks like somehow your Emacs is pretty printing the JSON across multiple lines instead of putting it in one? Did you somehow advise your json functions?

kritzcreek commented 4 years ago

I did a bit of reading and it seems there's a json-encoding-pretty-print parameter you might've set to true globally? It's terrible API design, because it makes it so I can't control that I want single line JSON. If you want to work with psc-ide-emacs you might have to turn that off.

goosetherumfoodle commented 4 years ago

Yup, removing that assignment fixed it. Thanks @kritzcreek !