Skip to content

Commit 2aa9b78

Browse files
sankheshmergify[bot]
authored andcommitted
Try starting Omnisharp server without solution file
With this change, ycmd will attempt to start the Omnisharp server with the current working directory when no solution file is found. The runtime check for solution file presence is not required and exception raising is defered to Omnisharp.
1 parent f53e7ac commit 2aa9b78

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ycmd/completers/cs/cs_completer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,13 @@ def _GetSolutionFile( self, filepath ):
381381
# to be confirmed
382382
path_to_solutionfile = solutiondetection.FindSolutionPath( filepath )
383383
if not path_to_solutionfile:
384-
raise RuntimeError( 'Autodetection of solution file failed.' )
384+
path_to_solutionfile = os.getcwd()
385+
LOGGER.info( 'Autodetection of solution file failed, '
386+
'trying current directory ({0}).'
387+
.format( path_to_solutionfile ) )
388+
else:
389+
LOGGER.info( 'Loading solution file {0}'
390+
.format( path_to_solutionfile ) )
385391
self._solution_for_file[ filepath ] = path_to_solutionfile
386392

387393
return self._solution_for_file[ filepath ]

0 commit comments

Comments
 (0)