Document YcmGetErrorCount and YcmGetWarningCount functions
This commit is contained in:
parent
dafc36ba37
commit
163238992c
24
README.md
24
README.md
@ -1122,6 +1122,30 @@ provides a list of implementations to choose from.
|
|||||||
|
|
||||||
Supported in filetypes: `cs`
|
Supported in filetypes: `cs`
|
||||||
|
|
||||||
|
Functions
|
||||||
|
--------
|
||||||
|
|
||||||
|
### The `YcmGetErrorCount` function
|
||||||
|
|
||||||
|
Get the number of YCM Diagnostic errors. If no errors are present, this function
|
||||||
|
returns 0.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
```viml
|
||||||
|
call YcmGetErrorCount()
|
||||||
|
```
|
||||||
|
|
||||||
|
### The `YcmGetWarningCount` function
|
||||||
|
|
||||||
|
Get the number of YCM Diagnostic warnings. If no warnings are present, this
|
||||||
|
function returns 0.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
```viml
|
||||||
|
call YcmGetWarningCount()
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -55,7 +55,10 @@ Contents ~
|
|||||||
14. The |ReloadSolution| subcommand
|
14. The |ReloadSolution| subcommand
|
||||||
15. The |GoToImplementation| subcommand
|
15. The |GoToImplementation| subcommand
|
||||||
16. The |GoToImplementationElseDeclaration| subcommand
|
16. The |GoToImplementationElseDeclaration| subcommand
|
||||||
8. Options |youcompleteme-options|
|
8. Functions |youcompleteme-functions|
|
||||||
|
1. The |YcmGetErrorCount| function
|
||||||
|
2. The |YcmGetWarningCount| function
|
||||||
|
9. Options |youcompleteme-options|
|
||||||
1. The |g:ycm_min_num_of_chars_for_completion| option
|
1. The |g:ycm_min_num_of_chars_for_completion| option
|
||||||
2. The |g:ycm_min_num_identifier_candidate_chars| option
|
2. The |g:ycm_min_num_identifier_candidate_chars| option
|
||||||
3. The |g:ycm_auto_trigger| option
|
3. The |g:ycm_auto_trigger| option
|
||||||
@ -101,7 +104,7 @@ Contents ~
|
|||||||
43. The |g:ycm_use_ultisnips_completer| option
|
43. The |g:ycm_use_ultisnips_completer| option
|
||||||
44. The |g:ycm_goto_buffer_command| option
|
44. The |g:ycm_goto_buffer_command| option
|
||||||
45. The |g:ycm_disable_for_files_larger_than_kb| option
|
45. The |g:ycm_disable_for_files_larger_than_kb| option
|
||||||
9. FAQ |youcompleteme-faq|
|
10. FAQ |youcompleteme-faq|
|
||||||
1. I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't |import-vim|
|
1. I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't |import-vim|
|
||||||
2. On very rare occasions Vim crashes when I tab through the completion menu |youcompleteme-on-very-rare-occasions-vim-crashes-when-i-tab-through-completion-menu|
|
2. On very rare occasions Vim crashes when I tab through the completion menu |youcompleteme-on-very-rare-occasions-vim-crashes-when-i-tab-through-completion-menu|
|
||||||
3. I get a linker warning regarding |libpython| on Mac when compiling YCM
|
3. I get a linker warning regarding |libpython| on Mac when compiling YCM
|
||||||
@ -1346,6 +1349,30 @@ provides a list of implementations to choose from.
|
|||||||
|
|
||||||
Supported in filetypes: 'cs'
|
Supported in filetypes: 'cs'
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
*youcompleteme-functions*
|
||||||
|
Functions ~
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The *YcmGetErrorCount* function
|
||||||
|
|
||||||
|
Get the number of YCM Diagnostic errors. If no errors are present, this function
|
||||||
|
returns 0.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
>
|
||||||
|
call YcmGetErrorCount()
|
||||||
|
<
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The *YcmGetWarningCount* function
|
||||||
|
|
||||||
|
Get the number of YCM Diagnostic warnings. If no warnings are present, this
|
||||||
|
function returns 0.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
>
|
||||||
|
call YcmGetWarningCount()
|
||||||
|
<
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*youcompleteme-options*
|
*youcompleteme-options*
|
||||||
Options ~
|
Options ~
|
||||||
|
@ -45,27 +45,11 @@ class DiagnosticInterface( object ):
|
|||||||
|
|
||||||
|
|
||||||
def GetErrorCount( self ):
|
def GetErrorCount( self ):
|
||||||
errors = 0
|
return len( self._FilterDiagnostics( _DiagnosticIsError ) )
|
||||||
line_to_diags = self._buffer_number_to_line_to_diags[
|
|
||||||
vim.current.buffer.number ]
|
|
||||||
|
|
||||||
for diags in line_to_diags.itervalues():
|
|
||||||
for diag in diags:
|
|
||||||
if _DiagnosticIsError( diag ):
|
|
||||||
errors += 1
|
|
||||||
return errors
|
|
||||||
|
|
||||||
|
|
||||||
def GetWarningCount( self ):
|
def GetWarningCount( self ):
|
||||||
warnings = 0
|
return len( self._FilterDiagnostics( _DiagnosticIsWarning ) )
|
||||||
line_to_diags = self._buffer_number_to_line_to_diags[
|
|
||||||
vim.current.buffer.number ]
|
|
||||||
|
|
||||||
for diags in line_to_diags.itervalues():
|
|
||||||
for diag in diags:
|
|
||||||
if _DiagnosticIsWarning( diag ):
|
|
||||||
warnings += 1
|
|
||||||
return warnings
|
|
||||||
|
|
||||||
|
|
||||||
def UpdateWithNewDiagnostics( self, diags ):
|
def UpdateWithNewDiagnostics( self, diags ):
|
||||||
@ -104,6 +88,16 @@ class DiagnosticInterface( object ):
|
|||||||
self._diag_message_needs_clearing = True
|
self._diag_message_needs_clearing = True
|
||||||
|
|
||||||
|
|
||||||
|
def _FilterDiagnostics( self, predicate ):
|
||||||
|
matched_diags = []
|
||||||
|
line_to_diags = self._buffer_number_to_line_to_diags[
|
||||||
|
vim.current.buffer.number ]
|
||||||
|
|
||||||
|
for diags in line_to_diags.itervalues():
|
||||||
|
matched_diags.extend( filter( predicate, diags ) )
|
||||||
|
return matched_diags
|
||||||
|
|
||||||
|
|
||||||
def _UpdateSquiggles( buffer_number_to_line_to_diags ):
|
def _UpdateSquiggles( buffer_number_to_line_to_diags ):
|
||||||
vimsupport.ClearYcmSyntaxMatches()
|
vimsupport.ClearYcmSyntaxMatches()
|
||||||
line_to_diags = buffer_number_to_line_to_diags[ vim.current.buffer.number ]
|
line_to_diags = buffer_number_to_line_to_diags[ vim.current.buffer.number ]
|
||||||
|
Loading…
Reference in New Issue
Block a user