ycmd using Vim stdin on Windows

This resolves YCM crash problems. Fixes #637.
This commit is contained in:
Strahinja Val Markovic 2013-11-07 14:53:15 -08:00
parent de0a8b613a
commit 0226ba4c90

View File

@ -98,10 +98,13 @@ class YouCompleteMe( object ):
std = 'stdout' ) std = 'stdout' )
self._server_stderr = filename_format.format( port = server_port, self._server_stderr = filename_format.format( port = server_port,
std = 'stderr' ) std = 'stderr' )
# We need this on Windows otherwise bad things happen. See issue #637.
stdin = subprocess.PIPE if utils.OnWindows() else None
with open( self._server_stderr, 'w' ) as fstderr: with open( self._server_stderr, 'w' ) as fstderr:
with open( self._server_stdout, 'w' ) as fstdout: with open( self._server_stdout, 'w' ) as fstdout:
self._server_popen = subprocess.Popen( args, self._server_popen = subprocess.Popen( args,
stdin = stdin,
stdout = fstdout, stdout = fstdout,
stderr = fstderr ) stderr = fstderr )
self._NotifyUserIfServerCrashed() self._NotifyUserIfServerCrashed()