Error message for old location libs

This commit is contained in:
Strahinja Val Markovic 2014-05-13 14:25:53 -07:00
parent bef84348dd
commit f1cf9186cb

View File

@ -43,26 +43,36 @@ elseif !has( 'python' )
endif endif
let s:script_folder_path = escape( expand( '<sfile>:p:h' ), '\' ) let s:script_folder_path = escape( expand( '<sfile>:p:h' ), '\' )
let s:python_folder_path = s:script_folder_path . '/../python/'
let s:ycmd_folder_path = s:script_folder_path . '/../third_party/ycmd'
function! s:HasYcmCore() function! s:YcmLibsPresentIn( path_prefix )
let path_prefix = s:script_folder_path . '/../python/' if filereadable(a:path_prefix . 'ycm_client_support.so') &&
if filereadable(path_prefix . 'ycm_client_support.so') && \ filereadable(a:path_prefix . 'ycm_core.so')
\ filereadable(path_prefix . 'ycm_core.so')
return 1 return 1
elseif filereadable(path_prefix . 'ycm_client_support.pyd') && elseif filereadable(a:path_prefix . 'ycm_client_support.pyd') &&
\ filereadable(path_prefix . 'ycm_core.pyd') \ filereadable(a:path_prefix . 'ycm_core.pyd')
return 1 return 1
elseif filereadable(path_prefix . 'ycm_client_support.dll') && elseif filereadable(a:path_prefix . 'ycm_client_support.dll') &&
\ filereadable(path_prefix . 'ycm_core.dll') \ filereadable(a:path_prefix . 'ycm_core.dll')
return 1 return 1
endif endif
return 0 return 0
endfunction endfunction
if s:YcmLibsPresentIn( s:python_folder_path )
echohl WarningMsg |
\ echomsg "YCM libraries found in old location; please RECOMPILE YCM." |
\ echohl None
call s:restore_cpo()
finish
endif
let g:ycm_check_if_ycm_core_present = let g:ycm_check_if_ycm_core_present =
\ get( g:, 'ycm_check_if_ycm_core_present', 1 ) \ get( g:, 'ycm_check_if_ycm_core_present', 1 )
if g:ycm_check_if_ycm_core_present && !s:HasYcmCore() if g:ycm_check_if_ycm_core_present &&
\ !s:YcmLibsPresentIn( s:ycmd_folder_path )
echohl WarningMsg | echohl WarningMsg |
\ echomsg "ycm_client_support.[so|pyd|dll] and " . \ echomsg "ycm_client_support.[so|pyd|dll] and " .
\ "ycm_core.[so|pyd|dll] not detected; you need to compile " . \ "ycm_core.[so|pyd|dll] not detected; you need to compile " .