Using python's abc module for the Completer class

This commit is contained in:
Strahinja Val Markovic 2012-07-28 12:24:25 -07:00
parent 76715bd94c
commit bfafad4f50

View File

@ -19,6 +19,7 @@
import vim
import indexer
import abc
MIN_NUM_CHARS = int( vim.eval( "g:ycm_min_num_of_chars_for_completion" ) )
CLANG_COMPLETION_ENABLED = int( vim.eval( "g:ycm_clang_completion_enabled" ) )
@ -27,10 +28,11 @@ MAX_IDENTIFIER_COMPLETIONS_RETURNED = 10
class Completer( object ):
__metaclass__ = abc.ABCMeta
def __init__( self ):
self.future = None
def AsyncCandidateRequestReady( self ):
if not self.future:
# We return True so that the caller can extract the default value from the
@ -44,7 +46,7 @@ class Completer( object ):
return []
return self.future.GetResults()
@abc.abstractmethod
def OnFileReadyToParse( self ):
pass