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 vim
|
||||||
import indexer
|
import indexer
|
||||||
|
import abc
|
||||||
|
|
||||||
MIN_NUM_CHARS = int( vim.eval( "g:ycm_min_num_of_chars_for_completion" ) )
|
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" ) )
|
CLANG_COMPLETION_ENABLED = int( vim.eval( "g:ycm_clang_completion_enabled" ) )
|
||||||
@ -27,10 +28,11 @@ MAX_IDENTIFIER_COMPLETIONS_RETURNED = 10
|
|||||||
|
|
||||||
|
|
||||||
class Completer( object ):
|
class Completer( object ):
|
||||||
|
__metaclass__ = abc.ABCMeta
|
||||||
|
|
||||||
def __init__( self ):
|
def __init__( self ):
|
||||||
self.future = None
|
self.future = None
|
||||||
|
|
||||||
|
|
||||||
def AsyncCandidateRequestReady( self ):
|
def AsyncCandidateRequestReady( self ):
|
||||||
if not self.future:
|
if not self.future:
|
||||||
# We return True so that the caller can extract the default value from the
|
# We return True so that the caller can extract the default value from the
|
||||||
@ -44,7 +46,7 @@ class Completer( object ):
|
|||||||
return []
|
return []
|
||||||
return self.future.GetResults()
|
return self.future.GetResults()
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
def OnFileReadyToParse( self ):
|
def OnFileReadyToParse( self ):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user