Skip to content

Commit

Permalink
Try starting Omnisharp server without solution file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sankhesh committed Oct 12, 2022
1 parent 0e13fec commit 3a708f9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ycmd/completers/cs/cs_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@ def _GetSolutionFile( self, filepath ):
# to be confirmed
path_to_solutionfile = solutiondetection.FindSolutionPath( filepath )
if not path_to_solutionfile:
raise RuntimeError( 'Autodetection of solution file failed.' )
path_to_solutionfile = os.getcwd()
LOGGER.info( 'Autodetection of solution file failed, '
'trying current directory ({0}).'
.format( path_to_solutionfile ) )
else:
LOGGER.info( 'Loading solution file {0}'
.format( path_to_solutionfile ) )
self._solution_for_file[ filepath ] = path_to_solutionfile

return self._solution_for_file[ filepath ]
Expand Down

0 comments on commit 3a708f9

Please sign in to comment.