Using python's abc module for the Completer class
This commit is contained in:
parent
76715bd94c
commit
bfafad4f50
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user