diff --git a/README.md b/README.md index 4b2f6c39..ca4d0b78 100644 --- a/README.md +++ b/README.md @@ -1125,24 +1125,24 @@ Supported in filetypes: `cs` Functions -------- -### The `YcmGetErrorCount` function +### The `youcompleteme#GetErrorCount` function Get the number of YCM Diagnostic errors. If no errors are present, this function returns 0. For example: ```viml - call YcmGetErrorCount() + call youcompleteme#GetErrorCount() ``` -### The `YcmGetWarningCount` function +### The `youcompleteme#GetWarningCount` function Get the number of YCM Diagnostic warnings. If no warnings are present, this function returns 0. For example: ```viml - call YcmGetWarningCount() + call youcompleteme#GetWarningCount() ``` diff --git a/autoload/youcompleteme.vim b/autoload/youcompleteme.vim index 586e9584..9158331f 100644 --- a/autoload/youcompleteme.vim +++ b/autoload/youcompleteme.vim @@ -111,6 +111,16 @@ function! youcompleteme#DisableCursorMovedAutocommands() endfunction +function! youcompleteme#GetErrorCount() + return pyeval( 'ycm_state.GetErrorCount()' ) +endfunction + + +function! youcompleteme#GetWarningCount() + return pyeval( 'ycm_state.GetWarningCount()' ) +endfunction + + function! s:SetUpPython() abort python << EOF import sys @@ -870,16 +880,6 @@ function! s:ShowDiagnostics() endfunction -function! g:YcmGetErrorCount() - return pyeval( 'ycm_state.GetErrorCount()' ) -endfunction - - -function! g:YcmGetWarningCount() - return pyeval( 'ycm_state.GetWarningCount()' ) -endfunction - - " This is basic vim plugin boilerplate let &cpo = s:save_cpo unlet s:save_cpo diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index c7b4228d..445ccb00 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -30,6 +30,7 @@ Contents ~ 8. Diagnostic display |youcompleteme-diagnostic-display| 1. C# Diagnostic Support |youcompleteme-c-diagnostic-support| 2. Diagnostic highlighting groups |youcompleteme-diagnostic-highlighting-groups| + 6. Commands |youcompleteme-commands| 1. The |:YcmRestartServer| command 2. The |:YcmForceCompileAndDiagnostics| command @@ -1231,9 +1232,9 @@ For example: class C { void f(); }; - + void C::f() { - + } < In the out-of-line definition of 'C::f', the semantic parent is the class 'C', @@ -1354,24 +1355,24 @@ Supported in filetypes: 'cs' Functions ~ ------------------------------------------------------------------------------- -The *YcmGetErrorCount* function +The *youcompleteme#GetErrorCount* function Get the number of YCM Diagnostic errors. If no errors are present, this function returns 0. For example: > - call YcmGetErrorCount() + call youcompleteme#GetErrorCount() < ------------------------------------------------------------------------------- -The *YcmGetWarningCount* function +The *youcompleteme#GetWarningCount* function Get the number of YCM Diagnostic warnings. If no warnings are present, this function returns 0. For example: > - call YcmGetWarningCount() + call youcompleteme#GetWarningCount() < =============================================================================== *youcompleteme-options*