Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions typescript/libs/node_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ def read_msg(stream, msgq, asyncReq, proc, asyncEventHandlers):
if len(header) == 0:
if state == 'init':
# log.info('0 byte line in stream when expecting header')
stderr = proc.stderr.read()
if stderr:
print('typescript error', stderr)
return proc.poll() is not None
else:
# Done reading header
Expand Down Expand Up @@ -272,11 +275,11 @@ def __init__(self, script_path):
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.SW_HIDE | subprocess.STARTF_USESHOWWINDOW
self.server_proc = subprocess.Popen(node_process_cmd,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, env=tsserver_env, startupinfo=si, bufsize=-1)
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=tsserver_env, startupinfo=si, bufsize=-1)
else:
log.debug("opening " + node_path + " " + script_path)
self.server_proc = subprocess.Popen(node_process_cmd,
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, env=tsserver_env, bufsize=-1)
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=tsserver_env, bufsize=-1)
except:
self.server_proc = None
# start reader thread
Expand Down Expand Up @@ -317,11 +320,11 @@ def start(self):
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.SW_HIDE | subprocess.STARTF_USESHOWWINDOW
self.server_proc = subprocess.Popen(
node_process_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, env=tsserver_env, startupinfo=si, bufsize=-1
node_process_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=tsserver_env, startupinfo=si, bufsize=-1
)
else:
self.server_proc = subprocess.Popen(
node_process_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, env=tsserver_env, bufsize=-1)
node_process_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=tsserver_env, bufsize=-1)

# start reader thread
if self.server_proc and (not self.server_proc.poll()):
Expand Down