WorkspaceCompletionSupport.st
changeset 5047 091548040432
parent 4870 2714e7b0261e
child 5086 6f3514837c99
child 5097 2d0d83f6599d
equal deleted inserted replaced
5046:bcbf8cb1b3d1 5047:091548040432
    28 
    28 
    29 !WorkspaceCompletionSupport methodsFor:'private'!
    29 !WorkspaceCompletionSupport methodsFor:'private'!
    30 
    30 
    31 computeCompletions
    31 computeCompletions
    32 
    32 
    33     |suggestions implementations actions anyFound contextOrNil|
    33     |suggestions implementations actions contextOrNil|
    34 
    34 
    35     "/ a hack
    35     "/ a hack
    36     (editView topView isKindOf: DebugView) ifTrue:[
    36     (editView topView isKindOf: DebugView) ifTrue:[
    37         contextOrNil := editView topView selectedContext.
    37         contextOrNil := editView topView selectedContext.
    38     ].
    38     ].
    39 
    39 
    40     UserInformation ignoreIn:[
    40     UserInformation ignoreIn:[
    41         anyFound := false.
       
    42         DoWhatIMeanSupport 
    41         DoWhatIMeanSupport 
    43             codeCompletionFor: editView codeAspect
    42             codeCompletionFor: editView codeAspect
    44             language: editView editedLanguage
    43             language: editView editedLanguage
    45             method:editView editedMethod
    44             method:editView editedMethod
    46             orClass:editView editedClass 
    45             orClass:editView editedClass 
    49             into:[:listOfSuggestions :listOfActions :titleWhenAsking |
    48             into:[:listOfSuggestions :listOfActions :titleWhenAsking |
    50 "/ (listOfSuggestions contains:[:l | l isEmptyOrNil]) ifTrue:[self halt].
    49 "/ (listOfSuggestions contains:[:l | l isEmptyOrNil]) ifTrue:[self halt].
    51                     suggestions := listOfSuggestions collect:[:entry | entry isArray ifTrue:[entry first] ifFalse:[entry]].
    50                     suggestions := listOfSuggestions collect:[:entry | entry isArray ifTrue:[entry first] ifFalse:[entry]].
    52                     implementations := listOfSuggestions collect:[:entry | entry isArray ifTrue:[entry second] ifFalse:[nil]].                            
    51                     implementations := listOfSuggestions collect:[:entry | entry isArray ifTrue:[entry second] ifFalse:[nil]].                            
    53                     actions := listOfActions.
    52                     actions := listOfActions.
    54                     anyFound := true.
       
    55                     nil "/ must return nil to avoid DWIM to do it itself (for now)
    53                     nil "/ must return nil to avoid DWIM to do it itself (for now)
    56             ]
    54             ]
    57     ].
    55     ].
    58     "/ anyFound ifFalse:[self halt].
       
    59     "/ Transcript show:'suggestions: '; showCR:suggestions.
    56     "/ Transcript show:'suggestions: '; showCR:suggestions.
    60     "/ Transcript show:'actions: '; showCR:actions.  
    57     "/ Transcript show:'actions: '; showCR:actions. 
    61     editView sensor
    58     editView sensor
    62         pushUserEvent:#'suggestionsArrived:implementations:actions:autoSelect:'
    59         pushUserEvent:#'suggestionsArrived:implementations:actions:autoSelect:'
    63         for:self
    60         for:self
    64         withArguments:{suggestions . implementations . actions . autoSelect }
    61         withArguments:{suggestions . implementations . actions . autoSelect }
    65 
    62 
   237 ! !
   234 ! !
   238 
   235 
   239 !WorkspaceCompletionSupport class methodsFor:'documentation'!
   236 !WorkspaceCompletionSupport class methodsFor:'documentation'!
   240 
   237 
   241 version
   238 version
   242     ^ '$Header: /cvs/stx/stx/libwidg/WorkspaceCompletionSupport.st,v 1.7 2014-01-28 19:27:02 cg Exp $'
   239     ^ '$Header: /cvs/stx/stx/libwidg/WorkspaceCompletionSupport.st,v 1.8 2014-06-01 11:05:56 cg Exp $'
   243 !
   240 !
   244 
   241 
   245 version_CVS
   242 version_CVS
   246     ^ '$Header: /cvs/stx/stx/libwidg/WorkspaceCompletionSupport.st,v 1.7 2014-01-28 19:27:02 cg Exp $'
   243     ^ '$Header: /cvs/stx/stx/libwidg/WorkspaceCompletionSupport.st,v 1.8 2014-06-01 11:05:56 cg Exp $'
   247 ! !
   244 ! !
   248 
   245