#NEWLINE# def get_completions( self , document , complete_event ) : #NEWLINE# #INDENT# word_before_cursor = document . get_word_before_cursor ( ) #NEWLINE# words = set ( ) #NEWLINE# for w in re . split ( '\\W' , document . text ) : #NEWLINE# #INDENT# if ( len ( w ) > 1 ) : #NEWLINE# #INDENT# if ( w . startswith ( w ) and ( w != word_before_cursor ) ) : #NEWLINE# #INDENT# words . add ( w ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for w in sorted ( words ) : #NEWLINE# #INDENT# ( yield Completion ( w , start_position = ( - len ( word_before_cursor ) ) ) )