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