From d4829f1ef941df59b2e28fe7d4f4b30e9767a5b7 Mon Sep 17 00:00:00 2001 From: nop00 Date: Wed, 4 Dec 2013 22:01:35 +0100 Subject: [PATCH] Fix OmniSharp launch under Windows --- python/ycm/completers/cs/cs_completer.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/ycm/completers/cs/cs_completer.py b/python/ycm/completers/cs/cs_completer.py index 9e2147bc..474c6289 100755 --- a/python/ycm/completers/cs/cs_completer.py +++ b/python/ycm/completers/cs/cs_completer.py @@ -150,14 +150,13 @@ class CsharpCompleter( Completer ): if not os.path.isfile( omnisharp ): raise RuntimeError( SERVER_NOT_FOUND_MSG.format( omnisharp ) ) - if not platform.startswith( 'win' ): - omnisharp = 'mono ' + omnisharp - path_to_solutionfile = os.path.join( folder, solutionfile ) - # command has to be provided as one string for some reason - command = [ omnisharp + ' -p ' + str( self._omnisharp_port ) + ' -s ' + + command = [ omnisharp, '-p', str( self._omnisharp_port ), '-s', path_to_solutionfile ] + if not platform.startswith( 'win' ): + command.insert(0, 'mono') + filename_format = os.path.join( utils.PathToTempDir(), 'omnisharp_{port}_{sln}_{std}.log' ) @@ -168,7 +167,7 @@ class CsharpCompleter( Completer ): with open( self._filename_stderr, 'w' ) as fstderr: with open( self._filename_stdout, 'w' ) as fstdout: - subprocess.Popen( command, stdout=fstdout, stderr=fstderr, shell=True ) + subprocess.Popen( command, stdout=fstdout, stderr=fstderr ) self._logger.info( 'Starting OmniSharp server' )