Skip to content

getChar + EOF prints non-protocol error even in ide-mode #394

Open
@meraymond2

Description

@meraymond2

Steps to Reproduce

Simply run idris2 --ide-mode and exit with ^C or ^D.

Expected Behavior

I'd expect similar behaviour to v1. A SIGINT closes the process quietly. An EOF does print an error, but it's properly formatted for the ide-protocol: 000036(:return (:error "<stdin>: hGetChar: end of file") 0).

Observed Behavior

On SIGINT, it prints Failed to read a character. On EOF, it prints Alas the file is done, aborting.


In my code, I'm parsing the IDE replies, and when it receives a message that's not in the ide-protocol, it crashes. I can work around that, but I also wanted to flag it up here. I don't mind attempting a fix either, but I wasn't sure if copying v1 was the desired behaviour. For example, those errors could just be printed to stderr instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions