Use new Omnisharp Server ready command
This commit is contained in:
parent
2bf3bd5cac
commit
5b5e182194
@ -69,6 +69,7 @@ class CsharpCompleter( Completer ):
|
||||
'StopServer',
|
||||
'RestartServer',
|
||||
'ServerRunning',
|
||||
'ServerReady',
|
||||
'GoToDefinition',
|
||||
'GoToDeclaration',
|
||||
'GoToDefinitionElseDeclaration' ]
|
||||
@ -95,6 +96,8 @@ class CsharpCompleter( Completer ):
|
||||
return self._StartServer( request_data )
|
||||
elif command == 'ServerRunning':
|
||||
return self._ServerIsRunning()
|
||||
elif command == 'ServerReady':
|
||||
return self._ServerIsReady()
|
||||
elif command in [ 'GoToDefinition',
|
||||
'GoToDeclaration',
|
||||
'GoToDefinitionElseDeclaration' ]:
|
||||
@ -221,6 +224,15 @@ class CsharpCompleter( Completer ):
|
||||
return False
|
||||
|
||||
|
||||
def _ServerIsReady( self ):
|
||||
""" Check if our OmniSharp server is ready """
|
||||
try:
|
||||
return bool( self._omnisharp_port and
|
||||
self._GetResponse( '/checkreadystatus', silent = True ) )
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
def _ServerLocation( self ):
|
||||
return 'http://localhost:' + str( self._omnisharp_port )
|
||||
|
||||
|
@ -73,7 +73,7 @@ def GetCompletions_CsCompleter_Works_test():
|
||||
while True:
|
||||
result = app.post_json( '/run_completer_command',
|
||||
BuildRequest( completer_target = 'filetype_default',
|
||||
command_arguments = ['ServerRunning'],
|
||||
command_arguments = ['ServerReady'],
|
||||
filetype = 'cs' ) ).json
|
||||
if result:
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user