Renamed CompletionSystem to IdentifierCompleter

This commit is contained in:
Strahinja Val Markovic 2012-07-10 23:30:44 -07:00
parent 39ecf76798
commit e78e0400d9
2 changed files with 8 additions and 8 deletions

View File

@ -65,19 +65,19 @@ function! youcompleteme#Enable()
py import vim py import vim
exe 'python sys.path = sys.path + ["' . s:script_folder_path . '/../python"]' exe 'python sys.path = sys.path + ["' . s:script_folder_path . '/../python"]'
py import ycm py import ycm
py csystem = ycm.CompletionSystem() py identcomp = ycm.IdentifierCompleter()
py clangcomp = ycm.ClangCompleter() py clangcomp = ycm.ClangCompleter()
endfunction endfunction
function! s:OnBufferVisit() function! s:OnBufferVisit()
call s:SetCompleteFunc() call s:SetCompleteFunc()
py csystem.AddBufferIdentifiers() py identcomp.AddBufferIdentifiers()
endfunction endfunction
function! s:OnCursorHold() function! s:OnCursorHold()
py csystem.AddBufferIdentifiers() py identcomp.AddBufferIdentifiers()
endfunction endfunction
@ -106,7 +106,7 @@ function! s:AddIdentifierIfNeeded()
if should_add_identifier != 1 if should_add_identifier != 1
return return
endif endif
py csystem.AddPreviousIdentifier() py identcomp.AddPreviousIdentifier()
endfunction endfunction
@ -161,12 +161,12 @@ function! s:IdentifierCompletion(query)
return [] return []
endif endif
py csystem.CandidatesForQueryAsync( vim.eval('a:query') ) py identcomp.CandidatesForQueryAsync( vim.eval('a:query') )
let l:results_ready = 0 let l:results_ready = 0
while !l:results_ready while !l:results_ready
py << EOF py << EOF
results_ready = csystem.AsyncCandidateRequestReady() results_ready = identcomp.AsyncCandidateRequestReady()
if results_ready: if results_ready:
vim.command( 'let l:results_ready = 1' ) vim.command( 'let l:results_ready = 1' )
EOF EOF
@ -177,7 +177,7 @@ EOF
let l:results = [] let l:results = []
py << EOF py << EOF
results = csystem.CandidatesFromStoredRequest() results = identcomp.CandidatesFromStoredRequest()
if results: if results:
vim.command( 'let l:results = ' + str( results ) ) vim.command( 'let l:results = ' + str( results ) )
EOF EOF

View File

@ -25,7 +25,7 @@ min_num_chars = int( vim.eval( "g:ycm_min_num_of_chars_for_completion" ) )
clang_filetypes = set( [ 'c', 'cpp', 'objc', 'objcpp' ] ) clang_filetypes = set( [ 'c', 'cpp', 'objc', 'objcpp' ] )
class CompletionSystem( object ): class IdentifierCompleter( object ):
def __init__( self ): def __init__( self ):
self.completer = indexer.IdentifierCompleter() self.completer = indexer.IdentifierCompleter()
self.completer.EnableThreading() self.completer.EnableThreading()