本文整理匯總了Python中ycm.youcompleteme.YouCompleteMe類的典型用法代碼示例。如果您正苦於以下問題:Python YouCompleteMe類的具體用法?Python YouCompleteMe怎麽用?Python YouCompleteMe使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了YouCompleteMe類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: OnCompleteDone_WithActionCallsIt_test
def OnCompleteDone_WithActionCallsIt_test( *args ):
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
action = MagicMock()
ycm_state._complete_done_hooks[ "txt" ] = action
ycm_state.OnCompleteDone()
assert action.called
示例2: FilterToCompletedCompletions_OldVim_ExactMatchIsReturned_test
def FilterToCompletedCompletions_OldVim_ExactMatchIsReturned_test( *args ):
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
completions = [ _BuildCompletion( "Test" ) ]
result = ycm_state._FilterToMatchingCompletions( completions, False )
eq_( list( result ), completions )
示例3: HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_test
def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_ShortTextDoesntRaise_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = False )
vimsupport.TextBeforeCursor = MagicMock( return_value = "X" )
completions = [ _BuildCompletion( "AAA" ) ]
ycm_state._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
示例4: FilterToCompletedCompletions_OldVim_ShortTextDoesntRaise_test
def FilterToCompletedCompletions_OldVim_ShortTextDoesntRaise_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = False )
vimsupport.TextBeforeCursor = MagicMock( return_value = "X" )
completions = [ _BuildCompletion( "AAA" ) ]
ycm_state._FilterToMatchingCompletions( completions, False )
示例5: HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test
def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test( *args ):
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
completions = [ _BuildCompletion( "A" ) ]
result = ycm_state._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
eq_( result, False )
示例6: FilterToCompletedCompletions_NewVim_ShortTextDoesntRaise_test
def FilterToCompletedCompletions_NewVim_ShortTextDoesntRaise_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = True )
vimsupport.GetVariableValue = GetVariableValue_CompleteItemIs( "A" )
completions = [ _BuildCompletion( "AAA" ) ]
ycm_state._FilterToMatchingCompletions( completions, False )
示例7: FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test
def FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test( *args ):
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
completions = [ _BuildCompletion( "A" ) ]
result = ycm_state._FilterToMatchingCompletions( completions, False )
assert_that( list( result ), empty() )
示例8: GetRequiredNamespaceImport_ReturnNamespaceFromExtraData_test
def GetRequiredNamespaceImport_ReturnNamespaceFromExtraData_test():
namespace = "A_NAMESPACE"
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
eq_( namespace, ycm_state._GetRequiredNamespaceImport(
_BuildCompletion( namespace )
))
示例9: HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_test
def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_ShortTextDoesntRaise_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = True )
vimsupport.GetVariableValue = GetVariableValue_CompleteItemIs( "X" )
completions = [ _BuildCompletion( "AAA" ) ]
ycm_state._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
示例10: OnCompleteDone_WithActionCallsIt_test
def OnCompleteDone_WithActionCallsIt_test():
vimsupport.CurrentFiletypes = MagicMock( return_value = [ "txt" ] )
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
action = MagicMock()
ycm_state._complete_done_hooks[ "txt" ] = action
ycm_state.OnCompleteDone()
assert action.called
示例11: HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_MatchIsReturned_test
def HasCompletionsThatCouldBeCompletedWithMoreText_OldVim_MatchIsReturned_test(
*args ):
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
completions = [ _BuildCompletion( "Test" ) ]
result = ycm_state._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
eq_( result, True )
示例12: HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test
def HasCompletionsThatCouldBeCompletedWithMoreText_NewVim_NonMatchIsntReturned_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = True )
vimsupport.GetVariableValue = GetVariableValue_CompleteItemIs( " Quote" )
completions = [ _BuildCompletion( "A" ) ]
result = ycm_state._HasCompletionsThatCouldBeCompletedWithMoreText( completions )
eq_( result, False )
示例13: FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test
def FilterToCompletedCompletions_OldVim_NonMatchIsntReturned_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = False )
vimsupport.TextBeforeCursor = MagicMock( return_value = " Quote" )
completions = [ _BuildCompletion( "A" ) ]
result = ycm_state._FilterToMatchingCompletions( completions, False )
assert_that( list( result ), empty() )
示例14: _SetupForCsharpCompletionDone
def _SetupForCsharpCompletionDone( completions ):
with patch( 'ycm.vimsupport.InsertNamespace' ):
with patch( 'ycm.vimsupport.TextBeforeCursor', return_value = ' Test' ):
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
request = MagicMock();
request.Done = MagicMock( return_value = True )
request.RawResponse = MagicMock( return_value = completions )
ycm_state._latest_completion_request = request
yield ycm_state
示例15: FilterToCompletedCompletions_OldVim_MatchIsReturned_test
def FilterToCompletedCompletions_OldVim_MatchIsReturned_test():
ycm_state = YouCompleteMe( MagicMock( spec_set = dict ) )
vimsupport.VimVersionAtLeast = MagicMock( return_value = False )
vimsupport.TextBeforeCursor = MagicMock( return_value = " Test" )
completions = [ _BuildCompletion( "Test" ) ]
result = ycm_state._FilterToMatchingCompletions( completions, False )
eq_( list( result ), completions )