DoWhatIMeanSupport.st
changeset 4379 f79671ee6211
parent 4378 02f4888b809a
child 4381 43de05e6af6c
equal deleted inserted replaced
4378:02f4888b809a 4379:f79671ee6211
  1090 ! !
  1090 ! !
  1091 
  1091 
  1092 !DoWhatIMeanSupport methodsFor:'code completion'!
  1092 !DoWhatIMeanSupport methodsFor:'code completion'!
  1093 
  1093 
  1094 codeCompletionForClass:classOrNilArg context:contextOrNil codeView:codeViewArg
  1094 codeCompletionForClass:classOrNilArg context:contextOrNil codeView:codeViewArg
  1095     "OBSOLETE; migrating to use the into protocol.
  1095     "OBSOLETE; migrating to use the the new 'xxx: into:' protocol.
  1096      contextOrNil is the current context, if this is called from the debugger;
  1096      contextOrNil is the current context, if this is called from the debugger;
  1097      nil, if called from the browser.
  1097      nil, if called from the browser.
  1098      If nonNil, we can make better guesses, because we actually know what a variable's type is.
  1098      If nonNil, we can make better guesses, because we actually know what a variable's type is.
  1099      This is not yet done, sigh"
  1099      This is not yet done, sigh"
  1100     
  1100     
  1275     "Modified: / 04-07-2006 / 18:48:26 / fm"
  1275     "Modified: / 04-07-2006 / 18:48:26 / fm"
  1276     "Modified: / 28-08-2013 / 17:15:25 / cg"
  1276     "Modified: / 28-08-2013 / 17:15:25 / cg"
  1277 !
  1277 !
  1278 
  1278 
  1279 codeCompletionForMethod:methodOrNilArg orClass:classOrNilArg context:contextOrNilArg codeView:codeViewArg into:actionBlock
  1279 codeCompletionForMethod:methodOrNilArg orClass:classOrNilArg context:contextOrNilArg codeView:codeViewArg into:actionBlock
  1280     "contextOrNil is the current context, if this is called from the debugger;
  1280     "provide code completion information by analyzing what the editing state is in codeViewArg
       
  1281      (cursor position, characters around cursor etc.) and calling back into actionBlock, passing
       
  1282      the info as argument. Te interface has been defined in that way (and tight coupling with internals
       
  1283      of the editor) because
       
  1284         1) the completer needs to know about the text around the cursor position
       
  1285         2) the edit operation for completion may be non-trivial
       
  1286            (although not yet fully implemented, non-local rewrite procedures may and will be added in the future
       
  1287      For example, in many situations, both a completion of a unary selector before the cursor,
       
  1288      or adding another keyword part after the cursor is posisble.
       
  1289      Thus, this provides a list of completions PLUS a list of edit operations (as per completion), to
       
  1290      perform the completion.
       
  1291      The caller has to open a dialog, providing the suggestions, and perform the corresponding edit operation.
       
  1292      An additional array containing a textual description for each suggestion is also provided, which could
       
  1293      be shown as info or appended to the suggestions (such as 'complete variable', 'complete keyword', etc.
       
  1294 
       
  1295      ContextOrNil is the current context, if this is called from the debugger;
  1281      or nil, if called from the browser.
  1296      or nil, if called from the browser.
  1282      If nonNil, we can make better guesses, because we actually know what a variable's type is"
  1297      If nonNil, we can make better guesses, because we actually know what a variable's type is"
  1283 
  1298 
  1284     |crsrPos char interval source partialSource suggestions1 suggestions2 actions1 actions2 title1 title2|
  1299     |crsrPos char interval source partialSource suggestions1 suggestions2 actions1 actions2 title1 title2|
  1285 
  1300 
  3941 ! !
  3956 ! !
  3942 
  3957 
  3943 !DoWhatIMeanSupport class methodsFor:'documentation'!
  3958 !DoWhatIMeanSupport class methodsFor:'documentation'!
  3944 
  3959 
  3945 version
  3960 version
  3946     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.150 2013-09-05 11:08:15 cg Exp $'
  3961     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.151 2013-09-05 11:15:03 cg Exp $'
  3947 !
  3962 !
  3948 
  3963 
  3949 version_CVS
  3964 version_CVS
  3950     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.150 2013-09-05 11:08:15 cg Exp $'
  3965     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.151 2013-09-05 11:15:03 cg Exp $'
  3951 ! !
  3966 ! !
  3952 
  3967