Skip to content

Commit

Permalink
Report closed InputOutputProvider. Not doing so cause problems on rep…
Browse files Browse the repository at this point in the history
…eated write.
  • Loading branch information
entlicher committed Apr 1, 2021
1 parent abd50d8 commit e4a9fb4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public final void closeIO(LspIO io) {

@Override
public final boolean isIOClosed(LspIO io) {
return false;
return io.closed;
}

@Override
Expand Down Expand Up @@ -133,6 +133,7 @@ public static final class LspIO {
final Reader in;
final PrintWriter out;
final PrintWriter err;
volatile boolean closed;

LspIO(String name, IOContext ioCtx, Lookup lookup) {
this.name = name;
Expand Down Expand Up @@ -170,6 +171,7 @@ public void flush() throws IOException {

@Override
public void close() throws IOException {
closed = true;
}
}
}
Expand Down

0 comments on commit e4a9fb4

Please sign in to comment.