Mantis - Squeak
Viewing Issue Advanced Details
1524 Tools minor always 07-22-05 19:06 07-22-05 21:08
0001524: [ENH] ImprovedBrowseIt
Note the comment in ParagraphEditor>>browseClassFromIt indicates a hierarchy
browser is to be used. But I've noticed the ambiguity that I think you're
alluding to. alternativeBrowseIt seems to do two things:

  1) open with a Hierarchy browser instead of a package browser.
  2) Be more friendly/responsive when the user requests to browse something
that doesn't exactly match a class-name in the system.

I think alternativeBrowseIt should toggle just between the two parts of #1.
This allows the user/developer to focus primarily on the object-model or the
package-model as he desires. (To have that function toggle between the
PackageBrowser or the PackagePaneBrowser seems to contradict our favorite axiom
that if two things are 99% the same we should make them the same or very

For 0000002, how about we make it more user-friendly all the time, regardless of the
alternativeBrowseIt setting. Today, when a new user browses "Int" without
alternativeBrowseIt turned on the system does nothing; no response. When is
this sort of behavior desirable?

I've attached a changeSet which I think does better. It follows these rules in
order of precedence:

  1) If you type an exactly matching class name, it automatically browses that
  2) If no exact match from #1, then it presents a list of the classes whose
name partially matches what you've typed, even if the match is only in the
  3) If there is no match from either of the first two rules, then it looks for
an exact-match of the capitalized Smalltalk-words inside the selection. For
example, if you are looking at Interval>>

  from: startInteger to: stopInteger

and you double click "startInteger" and browse it, the system brings up
Integer. If you browse "aGlobalPoint" you get Point and if you browse
"anOrderedCollection" you get a list to select between OrderedCollection or
Collection. So the system provides a next-best-guess alternative based on
Smalltalk naming conventions of prefixing with "a", "an" or some adjective.

The third rule is very nice for fast browsing. I've been using it for years
and have learned to type-imply my argument names so it will quickly open the
correct browser. No need for Chuck when browsing my own code.

Note, this changeset *only* changes the what-to-browse behavior; it does not
affect *which* browser is used to present it.

3.9 is a for-developers release, I think this changeSet should be considered
for inclusion.
 ImprovedBrowseIt.1.cs.gz [^] (1,147 bytes) 07-22-05 19:06
 ImprovedBrowseIt.2.cs.gz [^] (1,183 bytes) 07-22-05 21:08

07-22-05 19:09   
I loaded this into a 3.8-6665-basic image without errors but did not really test it as I had trouble understanding the description of what this changes.
07-22-05 21:07   
I have attached a slightly udpated version.

This changeset enhances the "alternativeBrowseIt" preference. When browsing code, method arguments are (and should be) typically type-inferring, for example:

  setItems: anOrderedCollection

Without this enhancement, double-clicking on "anOrderedCollection" (to highlight it) and pressing Alt+B, nothing happens. This enhancement allows quick browsing of the classes of the method arguments such as the above by ignoring lower-case prefixes such as "a" and "an" which are so common in method-argument names.

In some methods the argument may be named to type-infer its contents rather than the containing collection itself:

  setItems: myAssociations

in which case it smartly determines to browse the class "Association".

Finally, when in the debugger, you may have the expression in the code:

  anOrderedCollection first

and you want to browse the class of that first element. With this enhancement, you can highlight the expression and press "Browse" and it will evaluate the expression to determine the class of the result to browse. You can also test this in a workspace:

  (3/4) "browse it"