flush the options_file before start the ycmd server

- There are cases on windows that the ycmd will read an empty options
  file. So, flush the options file before start the ycmd server
This commit is contained in:
rxwen 2014-01-14 22:05:03 +08:00
parent b1bba2e201
commit 62949c42ed

View File

@ -84,6 +84,7 @@ class YouCompleteMe( object ):
with tempfile.NamedTemporaryFile( delete = False ) as options_file: with tempfile.NamedTemporaryFile( delete = False ) as options_file:
self._temp_options_filename = options_file.name self._temp_options_filename = options_file.name
json.dump( dict( self._user_options ), options_file ) json.dump( dict( self._user_options ), options_file )
options_file.flush()
args = [ utils.PathToPythonInterpreter(), args = [ utils.PathToPythonInterpreter(),
_PathToServerScript(), _PathToServerScript(),
'--port={0}'.format( server_port ), '--port={0}'.format( server_port ),