@@ -170,6 +170,9 @@ def read_msg(stream, msgq, asyncReq, proc, asyncEventHandlers):
170170 if len (header ) == 0 :
171171 if state == 'init' :
172172 # log.info('0 byte line in stream when expecting header')
173+ stderr = proc .stderr .read ()
174+ if stderr :
175+ print ('typescript error' , stderr )
173176 return proc .poll () is not None
174177 else :
175178 # Done reading header
@@ -272,11 +275,11 @@ def __init__(self, script_path):
272275 si = subprocess .STARTUPINFO ()
273276 si .dwFlags |= subprocess .SW_HIDE | subprocess .STARTF_USESHOWWINDOW
274277 self .server_proc = subprocess .Popen (node_process_cmd ,
275- stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .DEVNULL , env = tsserver_env , startupinfo = si , bufsize = - 1 )
278+ stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = tsserver_env , startupinfo = si , bufsize = - 1 )
276279 else :
277280 log .debug ("opening " + node_path + " " + script_path )
278281 self .server_proc = subprocess .Popen (node_process_cmd ,
279- stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .DEVNULL , env = tsserver_env , bufsize = - 1 )
282+ stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = tsserver_env , bufsize = - 1 )
280283 except :
281284 self .server_proc = None
282285 # start reader thread
@@ -317,11 +320,11 @@ def start(self):
317320 si = subprocess .STARTUPINFO ()
318321 si .dwFlags |= subprocess .SW_HIDE | subprocess .STARTF_USESHOWWINDOW
319322 self .server_proc = subprocess .Popen (
320- node_process_cmd , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .DEVNULL , env = tsserver_env , startupinfo = si , bufsize = - 1
323+ node_process_cmd , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = tsserver_env , startupinfo = si , bufsize = - 1
321324 )
322325 else :
323326 self .server_proc = subprocess .Popen (
324- node_process_cmd , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .DEVNULL , env = tsserver_env , bufsize = - 1 )
327+ node_process_cmd , stdin = subprocess .PIPE , stdout = subprocess .PIPE , stderr = subprocess .PIPE , env = tsserver_env , bufsize = - 1 )
325328
326329 # start reader thread
327330 if self .server_proc and (not self .server_proc .poll ()):
0 commit comments