Surfacing ycmd server PID to user scripts
To get the PID, call function youcompleteme#ServerPid().
This commit is contained in:
parent
5719a5e080
commit
6d9969fa9c
@ -588,6 +588,11 @@ function! youcompleteme#OmniComplete( findstart, base )
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! youcompleteme#ServerPid()
|
||||||
|
return pyeval( 'ycm_state.ServerPid()' )
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! s:RestartServer()
|
function! s:RestartServer()
|
||||||
py ycm_state.RestartServer()
|
py ycm_state.RestartServer()
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -217,3 +217,4 @@ def GetBoolValue( variable ):
|
|||||||
|
|
||||||
def GetIntValue( variable ):
|
def GetIntValue( variable ):
|
||||||
return int( vim.eval( variable ) )
|
return int( vim.eval( variable ) )
|
||||||
|
|
||||||
|
@ -109,6 +109,12 @@ class YouCompleteMe( object ):
|
|||||||
vimsupport.PostVimMessage( SERVER_CRASH_MESSAGE_SAME_STDERR )
|
vimsupport.PostVimMessage( SERVER_CRASH_MESSAGE_SAME_STDERR )
|
||||||
|
|
||||||
|
|
||||||
|
def ServerPid( self ):
|
||||||
|
if not self._server_popen:
|
||||||
|
return -1
|
||||||
|
return self._server_popen.pid
|
||||||
|
|
||||||
|
|
||||||
def RestartServer( self ):
|
def RestartServer( self ):
|
||||||
vimsupport.PostVimMessage( 'Restarting ycmd server...' )
|
vimsupport.PostVimMessage( 'Restarting ycmd server...' )
|
||||||
self.OnVimLeave()
|
self.OnVimLeave()
|
||||||
|
Loading…
Reference in New Issue
Block a user