DoWhatIMeanSupport.st
changeset 4302 f115f2ff999d
parent 4301 90f7571df306
child 4304 c1ac9271223b
equal deleted inserted replaced
4301:90f7571df306 4302:f115f2ff999d
  1293 !
  1293 !
  1294 
  1294 
  1295 codeCompletionForLiteralSymbol:node into:actionBlock
  1295 codeCompletionForLiteralSymbol:node into:actionBlock
  1296     |sym possibleCompletions best start stop oldLen newLen oldVar|
  1296     |sym possibleCompletions best start stop oldLen newLen oldVar|
  1297 
  1297 
  1298 Transcript show:'lit in '; show:methodOrNil; show:' / '; showCR:classOrNil.
  1298     "/ Transcript show:'lit in '; show:methodOrNil; show:' / '; showCR:classOrNil.
  1299 
  1299 
  1300     sym := node value.
  1300     sym := node value.
  1301     possibleCompletions := OrderedCollection new.
  1301     possibleCompletions := OrderedCollection new.
  1302 
  1302 
  1303     Symbol allInstancesDo:[:existingSym |
  1303     Symbol allInstancesDo:[:existingSym |
  1351      bestSelectors selector2 bestSelectors2 allBest best info numArgs
  1351      bestSelectors selector2 bestSelectors2 allBest best info numArgs
  1352      newParts nSelParts oldLen newLen selectorParts 
  1352      newParts nSelParts oldLen newLen selectorParts 
  1353      findBest parentNode selectorInBest selector2InBest2
  1353      findBest parentNode selectorInBest selector2InBest2
  1354      parser selectorsSentInCode split editAction|
  1354      parser selectorsSentInCode split editAction|
  1355 
  1355 
  1356 Transcript show:'msg in '; show:methodOrNil; show:' / '; showCR:classOrNil.
  1356     "/ Transcript show:'msg in '; show:methodOrNil; show:' / '; showCR:classOrNil.
  1357 
  1357 
  1358 "/    classOrNil notNil ifTrue:[
  1358 "/    classOrNil notNil ifTrue:[
  1359 "/        parser := Parser parseMethod:codeView contents string in:classOrNil ignoreErrors:true ignoreWarnings:true.
  1359 "/        parser := Parser parseMethod:codeView contents string in:classOrNil ignoreErrors:true ignoreWarnings:true.
  1360 "/        selectorsSentInCode := parser messagesSent.
  1360 "/        selectorsSentInCode := parser messagesSent.
  1361 "/    ].
  1361 "/    ].
  1793     |crsrPos
  1793     |crsrPos
  1794      selectorSoFar matchingSelectors
  1794      selectorSoFar matchingSelectors
  1795      selectors distances best rest 
  1795      selectors distances best rest 
  1796      allExistingMethods nameBag namesByCount selectors1 selectors2|  
  1796      allExistingMethods nameBag namesByCount selectors1 selectors2|  
  1797 
  1797 
  1798 Transcript showCR:'m'.
  1798     "/ Transcript showCR:'m'.
  1799     crsrPos := codeView characterPositionOfCursor - 1.
  1799     crsrPos := codeView characterPositionOfCursor - 1.
  1800 
  1800 
  1801     selectorSoFar := ''.
  1801     selectorSoFar := ''.
  1802     node selectorParts doWithIndex:[:partToken :argNr|
  1802     node selectorParts doWithIndex:[:partToken :argNr|
  1803         |part|
  1803         |part|
  1912     |crsrPos
  1912     |crsrPos
  1913      selectorSoFar matchingSelectors
  1913      selectorSoFar matchingSelectors
  1914      selectors distances best rest 
  1914      selectors distances best rest 
  1915      allExistingMethods nameBag namesByCount selectors1 selectors2|  
  1915      allExistingMethods nameBag namesByCount selectors1 selectors2|  
  1916 
  1916 
  1917 Transcript showCR:'m'.
  1917     "/ Transcript showCR:'m'.
  1918     crsrPos := codeView characterPositionOfCursor - 1.
  1918     crsrPos := codeView characterPositionOfCursor - 1.
  1919 
  1919 
  1920     selectorSoFar := ''.
  1920     selectorSoFar := ''.
  1921     node selectorParts doWithIndex:[:partToken :argNr|
  1921     node selectorParts doWithIndex:[:partToken :argNr|
  1922         |part|
  1922         |part|
  2131      char oldLen newLen 
  2131      char oldLen newLen 
  2132      getDistanceComputeBlockWithWeight addWithFactorBlock names allTheBest bestAssoc
  2132      getDistanceComputeBlockWithWeight addWithFactorBlock names allTheBest bestAssoc
  2133      globalFactor localFactor selectorOfMessageToNode tree implementors argIdx namesUsed kwPart
  2133      globalFactor localFactor selectorOfMessageToNode tree implementors argIdx namesUsed kwPart
  2134      editAction suggestions nameIsOK|
  2134      editAction suggestions nameIsOK|
  2135 
  2135 
  2136 Transcript show:'var in '; show:methodOrNil; show:' / '; showCR:classOrNil.
  2136     "/ Transcript show:'var in '; show:methodOrNil; show:' / '; showCR:classOrNil.
  2137     classOrNil notNil ifTrue:[
  2137     classOrNil notNil ifTrue:[
  2138         nonMetaClass := classOrNil theNonMetaclass.
  2138         nonMetaClass := classOrNil theNonMetaclass.
  2139     ].
  2139     ].
  2140 
  2140 
  2141     nm := node name.
  2141     nm := node name.
  2891                     rbTypes size == 1 ifTrue:[
  2891                     rbTypes size == 1 ifTrue:[
  2892                         rbType := rbTypes first.
  2892                         rbType := rbTypes first.
  2893                     ] ifFalse:[
  2893                     ] ifFalse:[
  2894                         rbType := Class commonSuperclassOf:rbTypes
  2894                         rbType := Class commonSuperclassOf:rbTypes
  2895                     ].
  2895                     ].
  2896                     (rbType notNil and:[rbType ~= Object]) ifTrue:[
  2896                     (rbType notNil "and:[rbType ~= Object]") ifTrue:[
  2897                         bestSelectorsFromRB := Parser findBest:30 selectorsFor:node selector in:rbType forCompletion:true.
  2897                         bestSelectorsFromRB := Parser findBest:30 selectorsFor:node selector in:rbType forCompletion:true.
  2898                     ].
  2898                     ].
  2899                 ]
  2899                 ]
  2900             ]
  2900             ]
  2901         ].
  2901         ].
  3487 ! !
  3487 ! !
  3488 
  3488 
  3489 !DoWhatIMeanSupport class methodsFor:'documentation'!
  3489 !DoWhatIMeanSupport class methodsFor:'documentation'!
  3490 
  3490 
  3491 version
  3491 version
  3492     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.108 2013-07-24 10:29:08 cg Exp $'
  3492     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.109 2013-07-24 10:41:24 cg Exp $'
  3493 !
  3493 !
  3494 
  3494 
  3495 version_CVS
  3495 version_CVS
  3496     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.108 2013-07-24 10:29:08 cg Exp $'
  3496     ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.109 2013-07-24 10:41:24 cg Exp $'
  3497 ! !
  3497 ! !
  3498 
  3498