Skip to content

Commit c548f4c

Browse files
committed
fix: conditionally stop on buffer close
1 parent 7d4fb57 commit c548f4c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/gen_lsp/buffer.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ defmodule GenLSP.Buffer do
127127
fn buffer ->
128128
case comm.read(comm_data, buffer) do
129129
:eof ->
130-
System.stop()
130+
if Application.get_env(:gen_lsp, :exit_on_end, true) do
131+
System.stop()
132+
end
133+
131134
{:halt, :ok}
132135

133136
{:error, reason} ->

test/test_helper.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Application.put_env(:gen_lsp, :wire_protocol, GenLSP.Test.Wire)
1+
Application.put_env(:gen_lsp, :exit_on_end, false)
22

33
ExUnit.start(capture_log: true)

0 commit comments

Comments
 (0)