FileContentsBrowser

Bijan Parsia bparsia at email.unc.edu
Mon Apr 23 02:18:40 UTC 2001



On Mon, 23 Apr 2001, Richard A. O'Keefe wrote:

> Someone 

A.k.a. Me. Bijan. He of tar, feathers, and silly advice (so they tell me
;))

>mentioned:
> > > Hmm. I guess I should mention the FileContentsBrowser too, which is let's
> > > you "FileIn" a changeset or .st file without loading it into the system,
> > > so you can browse and selectively file in stuff. One of my favorite tools!
> 
> NONE of the classes in the 'Tools-File Contents Browser' category have
> class comments.  It looks very useful, but where do I find out how to use it?

Right here on the good ole squeak list, of course. Documentation while u
wait!

And, yes, this isn't entirely (at all?) obvious. A hidden treat for you
delectation.

Open a file list.

Find a change set (i.e., a .cs file).

Select it.

Choose the yellow button menu item "browse code".

You'll get a File Contents Browser on the change set.

This tool is really wonderful for scoping out changes *without* mucking up
your image. You can browse the changes set as if it were filed in, and
selectively file it bits. Since no code is compiled, you can actually
browse syntactically invalid (er..I think....not if you have pretty
printing on for sure, though).

(Pretty printing in squeak is interesting since it actually parses the
code in the normal way (as opposed to having a list of keywords and regex
patterns). The downside is that pretty printing 1) isn't interactive
and dynamic and isn't likely to be and 2) if you have something funky
that isn't properly hooked up to the compiler/parse nodes, pretty
printing will break it. Often hard.)

For Programmatic access, check the class side of
FileContentsBrowser. #browseFile: and #browseFiles: are pretty straight
forward.

Ah! One nice feature of the FCB is that it displays diffs with current
methods, and tells you whether the method is new or existing in the
system. Very handy!

As for the Pseudo* classes, it helps to look at what they're
Pseudoing. Essentially, PseudoClass and PseudoMetaclass ape enough of
Class and MetaClass for PseudoClassOrganizer to work the way
ClassOraganizer works with a Browser.

Er..ok, that's sorta obvious, put that way. But the key I'm try to give is
that once you have a reasonably clear idea of the relationship between
Browsers and ClassOrganizers, PseudoClassOrganizer and FileContentsBrowser
become clearer.

Actually, it looks like PseudoClassOrganizer most deals with class
comments.

Hmm. I worked through this once before and now I've forgotten a lot :)

On interesting bit that instead of having a MethodDictionary and
CompiledMethods, and getting source code out of the sources and changes
file (see Behavior, espeically #sourceCodeAt:), PseudoClass has a
"source" dictionary which contains (selector
keyed) ChangeRecords. ChangeRecords are cool ;)

(Compare PseudoClass>>sourceCodeAt: with Behavior's to see what's up.)

Hmm. Browsing around it looks like the FBC should allow for munging
stuff. I have to figure out why I thought it didn't.

Ok! There's a topic for a SqueakNewsletter article, and probably far more
than Richard wanted :)

Cheers,
Bijan Parsia.





More information about the Squeak-dev mailing list