choice for multiple solutionfiles implemented
This commit is contained in:
parent
2743f96529
commit
d2a7fe9c0e
@ -84,20 +84,22 @@ class CsharpCompleter( ThreadedCompleter ):
|
|||||||
elif len( solutionfiles ) == 1:
|
elif len( solutionfiles ) == 1:
|
||||||
solutionfile = solutionfiles[0]
|
solutionfile = solutionfiles[0]
|
||||||
else:
|
else:
|
||||||
# This still has to be caught by giving the user a choice
|
choice = vimsupport.PresentDialog( "Which solutionfile should be loaded?",
|
||||||
vimsupport.PostVimMessage( 'Error starting OmniSharp server: multiple solutionfiles found' )
|
[ str(i) + " " + s for i, s in enumerate( solutionfiles ) ] )
|
||||||
|
if choice == -1:
|
||||||
|
vimsupport.PostVimMessage( 'OmniSharp not started' )
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
solutionfile = solutionfiles[ choice ]
|
||||||
|
|
||||||
omnisharp = os.path.join( os.path.abspath( os.path.dirname( __file__ ) ),
|
omnisharp = os.path.join( os.path.abspath( os.path.dirname( __file__ ) ),
|
||||||
'OmniSharpServer/OmniSharp/bin/Debug/OmniSharp.exe' )
|
'OmniSharpServer/OmniSharp/bin/Debug/OmniSharp.exe' )
|
||||||
solutionfile = os.path.join ( folder, solutionfile )
|
solutionfile = os.path.join ( folder, solutionfile )
|
||||||
# command has to be provided as one string
|
# command has to be provided as one string for some reason
|
||||||
command = [ omnisharp + ' -p ' + str( self.OmniSharpPort ) + ' -s ' + solutionfile ]
|
command = [ omnisharp + ' -p ' + str( self.OmniSharpPort ) + ' -s ' + solutionfile ]
|
||||||
|
|
||||||
vimsupport.PostVimMessage( 'starting server...\n' + ' '.join( command ) )
|
|
||||||
|
|
||||||
with open( os.devnull, "w" ) as fnull:
|
with open( os.devnull, "w" ) as fnull:
|
||||||
result = subprocess.Popen(command, stdout = fnull, stderr = fnull, shell=True)
|
subprocess.Popen( command, stdout = fnull, stderr = fnull, shell=True )
|
||||||
|
|
||||||
def _StopServer( self ):
|
def _StopServer( self ):
|
||||||
""" Stop the OmniSharp server """
|
""" Stop the OmniSharp server """
|
||||||
|
Loading…
Reference in New Issue
Block a user