Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Refactoring Browser
Last updated at 1:53 pm UTC on 9 September 2019
What is refactoring? See Refactoring.
When developing Smalltalk code to have the refactoring tools loaded is a MUST in most cases.

2019 Squeak 5.3alpha

Refactoring tools


SQUEAKMAPENTRYNEEDED


This script should load the updated version into a current Squeak 5.3alpha


 Installer ss
	project: 'MetacelloRepository';
	addPackage: 'ConfigurationOfRefactoringTools';
	install.
 (Smalltalk at: #ConfigurationOfRefactoringTools) project load: '2.0'.


ToDo: Retest
1. Get a pristine image
2. Load the Refactoring Tools
3. Run SUnit tests for AST and Refactoring


After the release 5.3

Old style load script
 Installer ss
  project: 'MetacelloRepository';
   addPackage: 'ConfigurationOfRefactoringTools';
   install.
 (Smalltalk at: #ConfigurationOfRefactoringTools) project load.


New style load script

 Metacello  new
       "squeaksource: 'MetacelloRepository'; "  "– this is the default for mcz-based Configurations"
       configuration: 'RefactoringTools';
       "version: #stable; "  "– this is the default"
       load.



2018 Squeak 5.2


The refactoring tools for Squeak 5.2 are available through SqueakMap as "Refactoring Tools".
For various older releases, you can find the dedicated "Refactoring Browser" there as well.

Related reading:
RBParser
RBProgramNodeVisitor
RBParseTreeRewriter
RBParser minimal example - parsing Smalltalk and generating code


For older versions:

2012


Per http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-September/165795.html

 [squeak-dev] OmniBrowser support now in trunk

The code snippet which is in the workspace accessible under 'Help',
'Extending the system'

    "Omnibrowser, including Refactoring engine"
    (Installer ss project: 'MetacelloRepository') install:
'ConfigurationOfOmniBrowser'.
    ((Smalltalk at: #ConfigurationOfOmniBrowser) project perform:
#lastVersion) load: #( Dev ).



The RefactoringBrowser is now a series of menues in the OmniBrowser. You get the OmniBrowser in your system by executing this code in a Workspace.

"Omnibrowser"
(Installer wiresong project: 'ob')
install: 'OmniBrowser';
install: 'OB-Morphic';
install: 'OB-Standard';
install: 'OB-Shout';
install: 'OB-SUnitIntegration'.

"Refactoring engine and OB integration"
(Installer ss project: 'rb')
install: 'AST';
install: 'Refactoring-Core';
install: 'Refactoring-Spelling';
project: 'Regex';
install: 'VB-Regex'.

(Installer wiresong project: 'ob')
install: 'OB-Refactory';
install: 'OB-Regex'.


Once you've done that, and you reach for a browser, it will ask you which of three browsers you want: Packaging, Omni, or regular. You can change from one to the other by clicking on a menu on the top rim of an open browser.

Chris (11 May, 2010)

The Refactoring Browser is a powerful Smalltalk Browser which allows the programmer to perform various automated Refactoringings on Smalltalk source code such as renaming variables and methods.

The Squeak version of the project lives on Squeaksource:
    MCHttpRepository
        location: 'http://www.squeaksource.com/rb'
        user: ''
        password: ''
which you can load via Monticello.

Alternatively you can use SqueakMap. After installing the right version from SqueakMap, you will have three new options in the open menu -
  1. Refactoring Browser
  2. Code finder
  3. Lint

If you have suggestions or problems, please mail them either to me or to the squeak-dev list.


2005 Squeak 3.8

Feb. 24, 2005: Ned Konz provided some enhancements for the RB for Squeak 3.8, including a RewriteTool.
It loads on top of the Refactory-md.3.8.12 version from SqueakMap.

His announcement:

I have put a Monticello diff file (against the current SqueakMap version of
Refactory, which is Refactory-md.3.8.12) on my site at:
http://bike-nomad.com/squeak/Refactory-nk.3823.mcd
You will have to load Refactory-md.3.8.12 first.

The big news here is the addition of the RewriteTool, which is like a pressure
washer for code janitors.

It is like the FinderTool in that it lets you search for parse tree (rather
than text) patterns in your code. But it also lets you specify a replacement
pattern. When you say "Replace" it puts up a FileContentsBrowser from which
you can view the proposed changes and load selected methods, classes, or the
entire set of changes.

I have also added the beginnings of a color formatter for the RB, but haven't
finished all the colors yet. You can now use the RB formatter for
pretty-printing tasks throughout the system. I have also improved its
printing of various things, including array literals.

Changes from Refactory-md.3.8.12 to Refactory-nk.3823

I am presenting it this way so people can get a chance to use it for a bit.



See also