當前位置: 首頁>>代碼示例>>Python>>正文


Python youcompleteme.YouCompleteMe類代碼示例

本文整理匯總了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
開發者ID:alistair,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alistair,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alistair,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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() )
開發者ID:alistair,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
  ))
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:7,代碼來源:postcomplete_tests.py

示例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
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:8,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alistair,項目名稱:YouCompleteMe,代碼行數:8,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:9,代碼來源:postcomplete_tests.py

示例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() )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:9,代碼來源:postcomplete_tests.py

示例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
開發者ID:alistair,項目名稱:YouCompleteMe,代碼行數:9,代碼來源:postcomplete_tests.py

示例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 )
開發者ID:alexrao,項目名稱:YouCompleteMe,代碼行數:9,代碼來源:postcomplete_tests.py


注:本文中的ycm.youcompleteme.YouCompleteMe類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。