Properly namespace vim warning/error getters

This commit is contained in:
Kenny Kaye 2015-12-05 09:24:15 -08:00
parent 163238992c
commit bb8490e6c7
3 changed files with 21 additions and 20 deletions

View File

@ -1125,24 +1125,24 @@ Supported in filetypes: `cs`
Functions Functions
-------- --------
### The `YcmGetErrorCount` function ### The `youcompleteme#GetErrorCount` function
Get the number of YCM Diagnostic errors. If no errors are present, this function Get the number of YCM Diagnostic errors. If no errors are present, this function
returns 0. returns 0.
For example: For example:
```viml ```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 Get the number of YCM Diagnostic warnings. If no warnings are present, this
function returns 0. function returns 0.
For example: For example:
```viml ```viml
call YcmGetWarningCount() call youcompleteme#GetWarningCount()
``` ```

View File

@ -111,6 +111,16 @@ function! youcompleteme#DisableCursorMovedAutocommands()
endfunction endfunction
function! youcompleteme#GetErrorCount()
return pyeval( 'ycm_state.GetErrorCount()' )
endfunction
function! youcompleteme#GetWarningCount()
return pyeval( 'ycm_state.GetWarningCount()' )
endfunction
function! s:SetUpPython() abort function! s:SetUpPython() abort
python << EOF python << EOF
import sys import sys
@ -870,16 +880,6 @@ function! s:ShowDiagnostics()
endfunction 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 " This is basic vim plugin boilerplate
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -30,6 +30,7 @@ Contents ~
8. Diagnostic display |youcompleteme-diagnostic-display| 8. Diagnostic display |youcompleteme-diagnostic-display|
1. C# Diagnostic Support |youcompleteme-c-diagnostic-support| 1. C# Diagnostic Support |youcompleteme-c-diagnostic-support|
2. Diagnostic highlighting groups |youcompleteme-diagnostic-highlighting-groups| 2. Diagnostic highlighting groups |youcompleteme-diagnostic-highlighting-groups|
6. Commands |youcompleteme-commands| 6. Commands |youcompleteme-commands|
1. The |:YcmRestartServer| command 1. The |:YcmRestartServer| command
2. The |:YcmForceCompileAndDiagnostics| command 2. The |:YcmForceCompileAndDiagnostics| command
@ -1354,24 +1355,24 @@ Supported in filetypes: 'cs'
Functions ~ Functions ~
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
The *YcmGetErrorCount* function The *youcompleteme#GetErrorCount* function
Get the number of YCM Diagnostic errors. If no errors are present, this function Get the number of YCM Diagnostic errors. If no errors are present, this function
returns 0. returns 0.
For example: 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 Get the number of YCM Diagnostic warnings. If no warnings are present, this
function returns 0. function returns 0.
For example: For example:
> >
call YcmGetWarningCount() call youcompleteme#GetWarningCount()
< <
=============================================================================== ===============================================================================
*youcompleteme-options* *youcompleteme-options*