Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip mono check on Linux with .NET 6.0 #1751

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions ycmd/completers/cs/cs_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
LOGFILE_FORMAT = 'omnisharp_{port}_{sln}_{std}_'


def MonoRequired( roslyn_path: str ):
return not utils.OnWindows() and roslyn_path.endswith( '.exe' )


def ShouldEnableCsCompleter( user_options ):
user_roslyn_path = user_options[ 'roslyn_binary_path' ]
if user_roslyn_path and not os.path.isfile( user_roslyn_path ):
Expand All @@ -67,12 +71,19 @@ def ShouldEnableCsCompleter( user_options ):
roslyn = user_roslyn_path
else:
roslyn = PATH_TO_OMNISHARP_ROSLYN_BINARY
mono = FindExecutableWithFallback( user_options[ 'mono_binary_path' ],
FindExecutable( 'mono' ) )
if roslyn and ( mono or utils.OnWindows() ):
return True
LOGGER.info( 'No mono executable at %s', mono )
return False

if not roslyn:
LOGGER.info( 'No roslyn executable at %s', roslyn )
return False

if MonoRequired( roslyn ):
mono = FindExecutableWithFallback( user_options[ 'mono_binary_path' ],
FindExecutable( 'mono' ) )
if not mono:
LOGGER.info( 'No mono executable at %s', mono )
return False

return True


class CsharpCompleter( Completer ):
Expand Down Expand Up @@ -438,8 +449,7 @@ def _ConstructOmnisharpCommand( self ):
'-s',
str( self._solution_path ) ]

if ( not utils.OnWindows()
and self._roslyn_path.endswith( '.exe' ) ):
if ( MonoRequired( self._roslyn_path ) ):
self._omnisharp_command.insert( 0, self._mono_path )

return self._omnisharp_command
Expand Down
Loading