Chapter 3 Browsers Enhancements

Chapter 3 Browsers Enhancements
Enhanced List Support
VA Assist Pro brings an advanced look and feel to VA Smalltalk. Gone are the simple black and white lists and simple hierarchical views. VA Assist Pro replaces the simple lists in all of the standard browsers with enhanced lists capable of displaying icons and color. Careful use of icons and color greatly increases the information bandwidth available to the developer. Examples include:
Use of color to indicate changed or scratch editions. Unversioned classes and applications are displayed in blue as are any methods that are new to those classes. Scratch applications and any classes or methods that have been changed within them are displayed in red.
Unreleased classes and applications are displayed with a green icons. Names and version numbers associated with unreleased subapplications are shown in lavender; names and version numbers of released subapplications are shown in black. Scratch classes or applications have a red “x” in their centers.
The icons of defined and extended classes are differentiated from one another, just as the controlling application of a class is differentiated from other applications that extend the class.
Loaded applications and config maps are differentiated from unloaded ones in the Application Configurations Browser and the Configuration Maps Browser. Loaded classes are differentiated from unloaded ones .
The manager of an application is differentiated from other group members .
Public and private instance methods are differentiated from one another.
Empty categories and hidden classes are grayed out.
Various attribute icons are used to indicate various special characteristics of classes and methods. Classes are marked whether they are abstract or not, runnable or not, Composition Editor or WindowBuilder Pro created, etc. Methods are marked whether they are abstract or not, whether they are subclass overrides , whether they are special GUI builder generated methods or whether they reference a missing method .
The various attribute icons and colors may be individually controlled via the (Options | Enhanced List Widgets) commands.
Some of the attribute and color calculations may be expensive of slower hardware so you can experiment with turning them on and off individually or as a group.
The background color of the enhanced lists may be controlled via the (Options | Enhanced List Widgets | Set List Background Color) command.
Hover help expansion of list elements in the enhanced lists may be controlled via the (Options | Enhanced List Widgets | Show Hover Help) command.
Drag Drop
A significant amount of time during any VA Smalltalk application development project is spent refactoring code, moving classes and methods between applications, recategorizing methods, changing methods from public to private and back, etc. All of these operations are time consuming and awkward using the standard VAST browsers. Many of these commands invoke multiple cascaded dialog boxes in order to figure out the intent of the developer. Drag/drop makes many of these operations much simpler and straightforward.
VA Assist Pro supports drag/drop operations between almost every list (and text) widget within the browsers – with useful copy and/or move semantics in each direction. The following table captures many of the various drag/drop operations available:
** Add/Change Categories in the same browser. Copy/Move method in a different browser.
Other combinations are also supported. For example, you can drag a method to the Public/Private button to change its status or drag it to the Class/Instance button to change it from being a class method to an instance method.
The drag drop button may be configured to be either the left, right or center mouse button via the (Options | Enhanced List Widget | Drag Drop Mouse Button) menu.
The drag/drop feature can be turned on and off via the (Options | Drag Drop) command. If drag drop is turned on and the drag drop mouse button is set to the left mouse button, drag/drop will interfere with the ability to drag select multiple items in the various browser lists. This option allows the user to quickly toggle drag/drop on and off. If the drag drop mouse button is set to the right mouse button, there is no conflict and drag/drop may be left on permanently.
Integrated History/Find ComboBox
One area where they could use a bit of help is navigating between classes. All of the browsers have a “Find Class” command that invokes a dialog in which you can enter a class name or wildcard search pattern. Once you click the OK button, the system dutifully finds the class you asked for or presents you with a list of possible alternatives. If you are building a complex system with a number of interlinked classes, you will find yourself using this feature a lot or you will find yourself opening a number of parallel browsers in order to minimize the number of times you have to hunt for a class. Wouldn't it be better if the browser kept track of where you had been and made it easy to go back to a class you had recently visited? Wouldn't it also be nice if the “Find Class” option were a bit easier to use and required fewer mouse clicks to access?
VA Assist Pro adds an integrated Find/History feature to all of the code browsers by adding an additional combobox to the upper left corner of each browser. The combobox keeps track of all of the classes you have most recently visited. Revisiting a class is as simple as selecting it from the drop down list. The combobox is also editable which allows you to type in a class name or a wild card expression and then hit enter. The specified class will then be found or a list of alternatives will be presented in a selection list.
If you are using a hierarchy browser and the selected class is not visible, the selected class will become the new base class of the browser.
Enhanced Code Editor (Windows Only)
VA Assist Pro replaces the code editor in the base product with a far more powerful editor. This enhanced editor offers advanced visualizations, code analytics, refactoring, a theming engine and much more. The editor is activated within the smalltalk browsers, debuggers, inspectors and workspaces.
Users who prefer to revert back to the legacy editor may do so by unchecking the setting "Use Scintilla Editor" from the VA Assist Pro settings. This can be accessed from the Transcript's Tools menu (Tools | VA Assist Pro | Settings | Use Scintilla Editor). VA Assist Pro's legacy editor provides so little compared to the current editor that it is not discussed any further within this documentation.
Context Sensitive Popup Editor Menu
One of the best things about Smalltalk and Smalltalk IDEs in general is that they are highly reflexive. Smalltalk systems can ask questions about themselves and generally get the right answers. When we develop in Smalltalk or are just learning about if for the first time, two of the most common questions that we ask are who uses and who implements a method. This is commonly referred to as asking for the “Senders” or “Implementors” of a method. These are two of the most commonly used functions within any Smalltalk IDE, and VA Smalltalk is no exception. As such, we want them to be as fast and user friendly as possible.
In VA Smalltalk, you can get the senders and implementors of a method in a variety of ways. If you know the exact spelling (or can copy and paste), you can use the “Browse Senders...” and “Browse Implementors...” commands in the Transcript's Tools menu. If you are looking at a method in a browser and see a method send that you would like to track down, you can pull down the Methods menu (or right-click in the methods list) in the browser and select the “Browse Messages” command which cascades to allow you to select “Implementors...” or “Senders...”. Either of these options will result in a popup selection dialog in which you can select the name of one of the messages sent within the current method.
Both of these alternatives work fine, but neither is very elegant. Wouldn't it be much better to simply click your mouse on a message selector (or within any part of it if it is a multi-keyword selector) and then right-click to access the standard popup text menu and just select either “Senders” or “Implementors”? This would be much easier, much quicker and more hypertext-like. The interesting part of the context menu is below:
There are two major ways in which this feature could be implemented - the simple way and the hard way. The simple way would be to allow the user to select any text, convert it into a symbol and then look it up. This approach can be implemented very quickly and easily (and is, in fact, how most browser hackers do implement it). The simple approach also doesn't work too well for multi-keyword messages (unless you get really fancy). VA Assist Pro does it the “hard” way, which is to use the Compiler to generate a parse tree and use that to pick out the appropriate selector.
The popup text menu in VA Assist Pro is also context sensitive. If you right click on a class name, you see “References”, “Browse Hierarchy” and “Edit Class”. “References” brings up a method browser showing all references to the class; “Browse Hierarchy” opens a class hierarchy browser on the class; and “Edit Class” opens the standard VA Smalltalk editor for a class (the Composition Editor for a visual part or a script browser for a non-visual part). The interesting part of the context menu is below.
Likewise, if you right click on a pool variable you see entries for “References”, “Find Definition” and “Inspect Pool”. “References” brings up a method browser showing all references to the pool variable; “Find Definition” opens a method browser on the PRAGMA method defining the pool variable; and “Inspect Pool” opens an inspector on the pool itself. See the context menu below.
Further customization of the popup text menu is possible via modifier keys. If you hold down the SHIFT key while right clicking on a method, you will see “Local Senders” and “Local Implementors” rather than “Senders” and “Implementors”. If you fold down the CTRL key, you will see “Application Senders” and “Application Implementors”. See sample context menu below.
 
Enhanced Keyboard Shortcuts
This section will present some of the additional keyboard shortcuts that are available in the enhanced editor. The enhanced editor has been developed to maintain the existing keyboard shortcuts available in the legacy editor, to the extent that was possible. As such, this will not be a comprehensive overview of all keyboard shortcuts, but rather the new keyboard shortcuts and behavior only available in the enhanced editor.
<Tab> - Indent/Block Indent. Press <Tab> to indent lines of text. If more than one line is selected, than all selected lines will be indented together (block indent).
<Shift+Tab> - Unindent/Block Unindent. Press to unindent lines of text. For single line unindent, position the text cursor at the beginning of the line and press <Shift+Tab>. To unindent multiple lines of text (block unindent), simply highlight the lines that should be unindented and press <Shift+Tab>
<Alt+Up> - Move Selected Lines Up.
<Alt+Down> - Move Selected Lines Down.
<Ctrl+L> - Delete Selected Lines.
<Ctrl+Alt> - Column selection. Hold this key combination while selecting text and it will produce multiple column-aligned selections which can be copy and pasted.
Selection Drag Drop
The user can select one or more lines of text, hover the mouse pointer over the text and drag to a different location by holding down the left mouse pointer during the drag. This allows the user to quickly relocate sections of text in a more visual manner. The user will see a visual indication on the mouse pointer that drag is active.
Multiple Undo/Redo
VA Assist adds multiple undo/redo text support to all enhanced editors within browsers, debuggers, inspectors and workspaces. There is no hard limit on the number of undo operations.
Furthermore, VA Assist's multiple undo/redo support includes coalescing, so contiguous insertions and deletions will be grouped into a single undo operation. This will keep the user from having to activate undo for every character that was typed, but instead VA Assist will attempt to choose sensible sets of characters to coalesce.
Hardware-Accelerated Rendering
VA Assist's new enhanced scintilla-based editor takes advantage of hardware-accelerated rendering through the use of Direct2D/DirectWrite technology. This allows many aspects of rendering, both font and effects, to be offloaded from the CPU to the Graphics Processing Units (GPU) onboard modern graphics cards.
In addition to performance improvements, the editor will be able to draw smoother, more visually appealing, fonts and effects than was previously possible.
The user can toggle DirectWrite at any time by using the Code Font Selection dialog available in the global File menu (File | Set Code Font...). On the bottom-right of the dialog box is a check box titled "Enable DirectWrite" which you may select/unselect.
Direct2D/DirectWrite is a fairly recent Microsoft technology and requires Windows 7 or above in order to make use of it.
Abbreviations
Abbreviation expansion is provided in all text views. Just type in an abbreviation and hit SHIFT+Space to have it expanded. For example, typing “int” followed by SHIFT+Space will replace the text “int” with “isNil ifTrue: []”. If an abbreviation expansion ends in a trailing bracket or parenthesis, the text insertion point is placed to its left. If no trailing bracket or parenthesis is included, the text insertion point is placed at the end of the expanded text. A number of different abbreviations are provided by default and all may be customized via the Abbreviations browser (Options | Abbreviations | Configure...).
An associated function makes it easy to enter variable names (method args, temporaries, inst vars and class vars). Just type the first letter or two of a variable name and hit F11. If the match is unambiguous, the variable name will be automatically entered. If more than one variable is a match, you will be asked to select the appropriate choice. Hit F11 by itself (without first entering some text) and a full list of available variables will be presented.
Auto Indent
If auto indent is turned on (Options | Auto Indent), the text insertion point will automatically indent to match the prior line when you hit Enter. If the prior line ended with a right bracket, the new line will indent one extra tab automatically (as is the norm for Smalltalk syntax).
Bracket Highlighting
Bracket Highlighting is the use of stylization to indicate matching pairs of ()[]{} enclosure characters. This feature is activated when the text cursor is positioned next to any of these characters and allows the user to quickly identify the start and end of enclosed expressions or blocks.
Additionally, bracket highlighting allows for stylization of unmatched enclosure characters in the event that the user added to many, or not enough, of them.
Bracket Highlighting may be quickly enabled/disabled by checking/unchecking the following menu item from any browser's Option menu (Options | Code Assist | Bracket Highlight)
Bracket Highlighting Configuration Options
Bracket Highlighting configuration options can be accessed by (Options | Code Assist | Configure...) in any browser menu and selecting "Bracket Highlight" from the Feature combo box in the Configuration UI.
The following is a description of all configuration options:
Enable Bracket Highlighting - Enable/Disable bracket highlighting in the global development environment.
Default: true
Bracket Highlight within Comments - Enable/Disable bracket highlighting within comments.
Default: false
Bracket Highlight within Strings - Enable/Disable bracket highlighting within comments.
Default: false
Enable Margin Marker - Enable/Disable margin marker to help show the location of offscreen matches.
Default: true
Smart Highlighting
Smart Highlighting is a useful feature to (optionally) apply stylization to a selected word, and separately have stylization applied to any matching words, in the editor. This allows the user to quickly see everywhere a particular word is used in the document without having to open up a search dialog and iterate through matches one by one.
During code editing, the user will often want to see where variables are defined or used within a given method. With smart highlighting, the user just needs to highlight the desired variable to instantly see all the matches in the view. All matches out of the current viewable area will be stylized once they are brought into view by scrolling.
Block arguments are often defined with a leading colon directly in front of the argument name, and will be included in the selection if the user double-clicks on the argument. Smart Highlighting takes this into account and will find the matching argument usages (which don't contain colons) even though the original selection includes a leading colon.
Smart Highlighting may be quickly enabled/disabled by checking/unchecking the following menu item from any browser's Option menu (Options | Code Assist | Smart Highlight)
Smart Highlighting Configuration Options
Smart Highlighting configuration options can be accessed by (Options | Code Assist | Configure...) in any browser menu and selecting "Smart Highlight" from the Feature combo box in the Configuration UI.
The configuration UI allows you to restore the default settings for the configuration items that are in view. This gives you the ability to restore just the settings in a particular category, without effecting the settings in other categories. If you would like to restore all settings, select the "All" category in the filter combo box and press the "Restore All Defaults" button on the bottom-left of the configuration UI.
The following is a description of all configuration options:
Enable Smart Highlighting - Enable/Disable smart highlighting in the global development environment.
Default: true
Stylize Selection - Apply stylization to the selected word, in addition to matched words. By default this is set to false which means that the selected word will retain the normal text selection color.
Default: false
 
Call Tips
VA Assist's enhanced editors implement call tips during debugging sessions. If a user hovers their mouse pointer over a variable or global in a debugger, a popup box will show just above the mouse pointer which displays the value of that variable or global. As an additional enhancement, the user may click the call tip which will bring up an inspector on that variable or global.
VA Assist keeps track of call tip regions. While the user's mouse pointer hovers within this region, the call tip will stay active. Once the user moves the mouse pointer outside this region, the call tip will automatically close. This region is a dynamically sized invisible box that encompasses the call tip and mouse pointer, and is designed to give the user the space required to drag the mouse pointer to the call tip.
Call tips will dynamically format their content so they don't take up to much display space. If the user wants to see the complete contents of a formatted call tip, they can click on it to bring up an inspector.
Action List Calltips
In some contexts, an interactive type of calltip will be displayed (called Action List Calltips). These calltips will typically start out in a collapsed state where it will simply display a brief message to the user like a normal calltip. However, there will be a down arrow button on the edge of the calltip that, once pressed, will uncollapse to produce a list from which items can be selected (as shown above).
When an action list calltip is showing, the user can use the mouse to press the up/down arrows on the calltip. This will change the selected item in the list. Applying the selected item is done by double-clicking the calltip.
If the "Traversal Keys Enabled" configuration option is true, then the keyboard can also be used to select and apply a list item in a manner similar to any normal list widget.
Call Tips Configuration Options
Call Tips configuration options can be accessed by (Options | Code Assist | Configure...) in any browser menu and selecting "Call Tips" from the Feature combo box in the Configuration UI.
The following is a description of all configuration options:
Enable Debugger Call Tips - Enable/Disable call tips in the global development environment. If enabled, call tips will be available during debugging sessions. Default: true
Popup Delay (ms) - Once the mouse cursor is positioned over a call tip region, this option defines the number of milliseconds to wait before call tips will show.
Default: 300
Traversal Keys Enabled - Used for action list calltips that mimic list widgets. If this is enabled, the the up/down arrows on the keyboard can be used to change the selected item within the calltip list. Pressing <Enter> will apply the selected item. Default: true
Line Numbers
VA Assist Pro code editor can be configured to show line numbers in the left margin area. Line numbers are supported in browsers, debuggers, inspectors and workspaces and can be configured independently of one another.
To enable/disable line numbers for one or more of the window types listed above, open the VA Assist Pro Setup dialog available from the Transcript's Tools menu (Tools | VA Assist Pro | Setup) and select the "General" tab. In the Scintilla section the user will find a sub-section named "Show Line Numbers". From this sub-section the user can specify the various window types that should show line numbers. Once an item is checked, the change will take place immediately.
Code Folding
VA Assist Pro's editor offers a sophisticated code folding feature. Code folding allows for sections of code to be hidden or shown selectively. In VA Smalltalk, this feature is used for multiline comments. Folding a multiline comment collapses what may potentially be a page or more worth of comments down to just one line. By doing so, the developer can quickly see the source code and expand the comments back again when they wish.
A special margin, called the folding margin, exists on the left part of the editor. This margin shows a series of markers to indicate if the comment is expanded or collapsed. Code Folding may be quickly enabled/disabled by checking/unchecking the following menu item from any browser's Option menu (Options | Code Assist | Code Folding)
Code Folding Configuration Options
Code Folding configuration options can be accessed by (Options | Code Assist | Configure...) in any browser menu and selecting "Code Folding" from the Feature combo box in the Configuration UI.
The following is a description of all configuration options:
Enable Code Folding - Enable/Disable code folding within the environment. Default: true
Collapsed Fold Decoration - Visual indication used for folding areas that have been collapsed.
Default: None
Show in Browsers - Show/Hide in the browsers if code folding is enabled.
Default: true
Show in Debuggers - Show/Hide in the debuggers if code folding is enabled. Default: true
Show in Inspectors - Show/Hide in the inspectors if code folding is enabled. Default: false
Show in Workspaces - Show/Hide in the workspaces if code folding is enabled. Default: false
Folding Threshold - The number of lines in a multiline comment before folding will be applied. A threshold of 2 means all multiline comments will have folding applied. Default: 2
Auto-Collapse Policy - Policy to control which foldable comments are automatically collapsed when new content loads.
Default: Disabled
Enable Selection Block Highlighting - Enable highlighting in the margin of the selected fold block.
Default: true
Themes
VA Assist Pro's offers a fully customized theme engine for the code editor. This means that every single visual effect used within the editor is decorated according to a specified theme.
Editor Theme UI
A theme is a specification of visual stylizations that are to be applied to various named items in the editor. These themes can be named and saved so the user can easily switch between themes.
In order to facilitate the creation and modification of themes, a UI is available that allows the user to tweak any available theme setting. This UI can be accessed from the Options menu of any browser (Options | Editor Theme | Configure...).
There are a number of predefined themes to choose from. Once the Editor Theme UI is open, just change the theme from the Theme combobox. To make your own themes, simply choose one of the predefined themes, make your style changes, and press the Save As... button (to the right of the Theme combobox). This will allow you to name and save your new theme.
There are a large number of theme Items available. While you can look through all the choices from the Items combobox, it is far simpler to simply click on the visual item you wish to modify inside the sample editor. Doing so will automatically select it from the Items combobox.
Once an item is chosen, you will see a preview of it in the Style section of the UI (Below the Save As... and Reset button). Within this section is a dropdown arrow, which when clicked, will display a style customization panel that is unique to the item chosen. Depending on the item, you can tweak styles like foreground and background colors, fonts names and sizes and various transparency settings. The preview within the Style section will constantly update to show you what impact your setting changes are having.
Syntax Color Highlighting
The largest collection of styled items within a theme are used for syntax color highlighting. Syntax color highlighting is a bit of a misnomer because VA Assist Pro's implementation can change not just the color, but also the font name and size. However, this is traditionally what this feature is called.
VA Assist Pro's syntax color highlighting will color text as you type it. This is different from most legacy implementations that typically wait for a period of time to elapse and then calculate the colors all at once.
Since syntax color highlighting is available in workspaces and inspectors, VA Assist Pro's implementation provides much higher levels of fault-tolerance when it comes to determining what visual style various tokens should use. This is important because it is not always reasonable to expect that text found in workspaces and inspectors create well-formed source (a general requirement for parsers).
Customizable Tool Bars
The lack of standard (and expected) toolbars in the various VA Smalltalk browser windows is one of factors making the tool appear dated. Almost all modern applications provide toolbars for fast access to frequently accessed functions. VA Assist Pro provides for customizable toolbars in all of the browser windows. Each browser type has a default toolbar line up that can be edited via the included toolbar editor. Most common menu commands may be represented as toolbar items in a browser's toolbar.
In many cases, the toolbar commands are easier to use than their menu-based counterparts. A single toolbar command may be context sensitive and represent multiple different menu commands. For example, the “Name Edition” command can be used to rename an application or class or version an application or class depending on the context.
Toolbars may be turned on and off on a browser by browser basis or for all browsers as a whole (in the case that the user does not want toolbars at all).
Edit Bar
VA Assist Pro provides an optional edit bar in the information area of most code browser windows. This edit bar gives the user quick access to the following commands: indent, un-indent, comment, un-comment, insert brackets and insert parens. The edit bar can be turned on and off via the Setup window.
Code Completion
Code completion is a feature that most modern development environments have that can predict how to complete a given token in an expression as you are typing it. The advantage of this is that it can save numerous keystrokes over time, as well as freeing you from the burden of having to remember the exact name of all the methods and classes that you use in your programming vocabulary.
Code completion, in general, must strike an interesting balance in order to be effective to you, the programmer. On one hand, code completion should strive to offer an accurate and generally complete set of suggestions. While on the other hand, too many suggestions may lead to cognitive overload, which can have an adverse effect on your ability to program. The code completion engine in VA Assist Pro attempts to achieve this balance by performing real-time code analysis in order to assemble a smaller set of more relevant suggestions. The code completion offered in VA Assist Pro is a customizable experience that can be tailored to better fit your programming style.
Code Completion Contexts
Code completion is available in four basic contexts. These contexts are Smalltalk browsers, inspectors, workspaces and debuggers. Code completion provides unique capabilities for each context.
Browsers - Code completion is available in many of the Smalltalk browsers. When browsing classes, implementors, senders and so on, these browsers contain state which code completion uses to derive the classes and methods that are visible. This is useful if you only want to see classes and methods visible in the prerequisite application chain.
Inspectors - Code completion hooks into the text editors available inside a VA Assist inspector. The code completion engine uses the additional runtime information available in an inspector to provide more accurate suggestions.
Workspaces - Workspaces don't have a sense of visibility in the same way browsers do. In workspaces, everything in the system is visible. The nice thing about VA Assist workspaces is that they maintain the values of evaluated variables that are defined. Code completion ties into this behavior, and will use the additional information to resolve the type of a variable.
Debuggers - Code completion even hooks into the debugger. In addition to all the capability provided by a general Smalltalk browser, code completion will use the runtime information available to resolve types of variables and arguments.
Code Completion Configuration Options
Configuration options for code completion are stored in the ENVY manager repository by user. This means that each user will have access to their unique set of configurations from any Smalltalk client connected to an ENVY manager instance.
Code completion configuration options can be accessed by (Options | Code Assist | Configure...) in any browser menu and selecting "Code Completion" from the Feature combo box in the Configuration UI. Because there are so many available options that allow you to customize your experience using Code Completion, a Filter combo box has been provided that shows the various options in logical categories. A complete description of each configuration option will be provided below.

The configuration UI allows you to restore the default settings for the configuration items that are in view. This gives you the ability to restore just the settings in a particular category, without effecting the settings in other categories. If you would like to restore all settings, select the "All" category in the filter combo box and press the "Restore All Defaults" button on the bottom-left of the configuration UI.
The configuration UI also gives you access to a summary of the current key bindings that can be used for various code completion actions. To see a description of these, press the "Key Bindings" button located on the bottom-right of the configuration UI.
Tip: If you would like a reminder of what an option does, you can hover the mouse pointer over the option name and a tooltip will show with a brief description. AbtEwHoverHelp class must be loaded in the image for tooltip support.
Basic Configuration Options
The options in this category provide ways to tweak the Code Completion experience in a course-grained fashion, and serve as a good starting point to customizing your experience. Many of these options are supported, in various flavors, by other popular development environments that offer code completion.
Enable Suggestion DragNDrop - If set to true, then completion suggestions can be dragged out of the popup and dropped anywhere outside. In doing so, a relevant Smalltalk browser will be displayed where the drop occurred. The type of browser displayed will depend on the type of completion. If the <Ctrl> key is NOT held during the drop, then a Class/Implementors browser will be displayed for the suggestion. If the <Ctrl> key IS held during the drop, then a References/Senders browser will be displayed.
Default: true

Note: Local Variable and Character completions do not support DragNDrop.
Completion Insert Policy - The default policy to use when applying a completion to the text editor. Because there are only two policies, you may hold down the <Ctrl> key when applying a completion and the other (non-default) insert policy will be used instead.
Append - When a completion is applied, it is inserted at the cursor point without overwriting any of the characters after the cursor
Overwrite - When a completion is applied, it is inserted at the cursor point and will overwrite any additional characters after the cursor up to, what is perceived as, a word boundary.
Default: Append
Smart Space After Insert Policy - This policy describes the type of completions that should have a space appended to them when applied to the text editor. However, if it is found that an additional separator already exists after the insert point in the editor, then the additional space will not be appended. You can specify that this policy applies to any combination of Classes, Variables and Methods.
Default: Classes
Prefix Match Policy - This policy describes how prefix matching is configured. Prefix matching algorithms will attempt to match the partial string in the text editor with the prefix of candidate completion suggestions according to the policies described below:
Disabled - Do not allow prefix matching
Case Sensitive - The characters in the partial string must exactly match (same case) the characters that make up the prefix of candidate completions.
Case Insensitive - The characters in the partial string must have a case-insensitive equivalence (same character) with the characters that make up the prefix of candidate completions.
Default: Case Insensitive

Tip: Why would you ever disable prefix matches? As you will see, code completion has support for other, often more powerful, types of match algorithms. Some developers may wish to only rely on code completion using non-prefix match algorithms. This has the effect of further reducing the overall number of suggestions in the completion popup, which is always a target goal.
CamelCase Match Policy - This policy describes how CamelCase matching is configured. CamelCase matching allows for a flexible way to filter completion suggestions by aligning the characters in the partial string with "camel humps" found in candidate completion strings. "Camel humps" are the uppercase characters in a camel-case name. For example, the letters 'O' and 'C' are "camel humps" in the method name "asOrderedCollection". One of many patterns to match this method name using camel-case matching would be the pattern "aOC". The CamelCase Matching algorithm is configured based on the policies described below.
Disabled - Do not allow camel-case matching
Very Strict - Uppercase characters in the partial string are REQUIRED to match "camel humps" in the candidate string. Furthermore, the number of "camel humps" in the partial string is REQUIRED to have the same number of "camel humps" in a given candidate completion.
Example: "ReadWriteStream" can be matched by typing "RWS", but not "rws" or "RW"
Strict - Uppercase characters in the partial string are REQUIRED to match "camel humps" in the candidate string. However, the number of "camel humps" in the partial string is NOT REQUIRED to have the same number of "camel humps" in a given candidate completion.
Example: "ReadWriteStream" can be matched by typing "RW" or "ReWr", but not "rws"
Lenient - Shiftless CamelCase. Uppercase characters in the partial string are NOT REQUIRED to match "camel humps" in the candidate string, though it must be the same letter (No shift required). Furthermore, the number of "camel humps" in the partial string is REQUIRED to have the same number of "camel humps" in a given candidate completion.
Example: "ReadWriteStream" can be matched by typing "rws", but not "rwri"
Very Lenient - Shiftless CamelCase. Uppercase characters in the partial string are NOT REQUIRED to match "camel humps" in the candidate string, though it must be the same letter (No shift required). Furthermore, the number of "camel humps" in the partial string is NOT REQUIRED to have the same number of "camel humps" in a given candidate completion.
Example: "ReadWriteStream" can be matched with "rw", "rwri" or "rws"
Default: Very Lenient
Method Visibility Policy - This policy describes which method suggestions should be shown based on their visibility (i.e. Public, Private or both (All)). This is only applicable when a method suggestion can be mapped to a single method.
Default: All

Live Filtering Support: When the completion popup is visible, and showing public/private methods, you can press <Ctrl+Shift+P> to cycle through the various method visibility policies. When performing live filtering, adjustments to the policy will only be retained while the popup is visible. Once the popup is closed, the original policy defined by your configuration will be reinstated.
Application Visibility Policy - This policy describes the application visibility rules to use when computing completion suggestions for the browsers and debuggers. This policy evaluates concepts such as prerequisite chains, and therefore will have no impact on what is shown in an inspector or workspace.

Because of the flexibility of Smalltalk browsers, answering a seemingly simple question such as "What applications can I see?" is actually non-trivial. A combination of methods, classes and applications currently selected in a browser is used to come up with an initial answer. However, the algorithm also detects to see if you're modifying just the body of a selected method, or the method signature as well. This information is used to assemble a prerequisite application chain.
The algorithm tries to take the conservative approach and assemble the largest set of visible applications when faced with ambiguity.

The prerequisite algorithm is mostly modeled after what would happen if you modify a method in a browser and pressed save. To get an idea of the ambiguity that exists, if showing inherited methods in a class hierarchy browser, and you completely rewrite the method signature and body of a selected inherited method, upon pressing "save" the browser will ask a series of questions about what object and application it should be saved to. The set of all visible applications should include all possibilities.

The following is a description of the available policies:
All - All Objects and Methods will be considered when computing completion suggestions.
Prerequisites - Only Objects and Methods that are perceived as being in the prerequisite chain will be available when computing completion suggestions.
Default: Prerequisites

Live Filtering Support: When the completion popup is visible in a browser or debugger, you can press <Ctrl+Shift+U> to cycle through the various application visibility policies. When performing live filtering, adjustments to the policy will only be retained while the popup is visible. Once the popup is closed, the original policy defined by your configuration will be reinstated.
Object Application Visibility Policy - This policy provides an additional refinement to prerequisite application visibilities, and therefore is only applicable if the "Application Visibility Policy" is set to prerequisites.
Prerequisites - This is the default policy, and has no perceivable impact since the "Application Visibility Policy" is also set to prerequisites.
Kernel Application and SubApplications - With this policy, method completions, whose defining class is Object, will be filtered out UNLESS the method is defined in Kernel or any of Kernel's SubApplications. In the interest of being pragmatic, method extensions to Object in, what is determined to be, the current root application will also be included.
Default: Prerequisites

Tip: When would you use this? Object has a lot of methods. If you are finding that the completion popup is being cluttered up with Object methods in your prerequisite chain that you don't generally use, try setting this option to "Kernel Application and SubApplications" to reduce the overall size of the completion list.
Advanced Configuration Options
The options in this category provide finer-grained tweaks that you may, or may not, be interested in. These options provide some additional ways to customize the code completion experience.
AutoPopup Traversal Key Enabled - If set to false, and the completion popup is displayed automatically (i.e. "Auto Completion Popup Enabled" is set to true), then using the traversal keys (Up, Down, Left, Right Arrows, PageUp and PageDown) will force the popup to close, and those keys will perform their appropriate action in the text editor. In order to scroll through selections in the completion list, you may hold down the <Ctrl> key and press any of the traversal keys, except for Left and Right arrows, since <Ctrl-Left> and <Ctrl-Right> are reserved for cursor placement behavior in the text editors. This option will have no effect on completion popups that are shown in response to a user request
Default: true

Tip: When would you use this? If you find that you generally only accept completions when they are at (or near) the top of the completion list (or you prefer to use a mouse click), and find it annoying that the traversal keys you meant for the editor are getting intercepted by the popup, then you may want to try setting this option to false. Remember that you can still select items in the popup using these keys...you just need to hold the <Ctrl> key down during the key press.
AutoPopup Select First Suggestion - If set to false, and the completion popup is displayed automatically (i.e. "Auto Completion Popup Enabled" is true), then the completion popup will show with no pre-selected completion suggestion. You can press the Down arrow key to highlight the first suggestion. This option will have no effect on completion popups that are shown in response to a user request.
Default: true

Tip: When would you use this? If you find that you like having the completion popup automatically show, but you feel strongly that pressing either <Enter> or <Tab> (depending on your "Accept Suggestion Key" setting) should actually be applied to the text editor until you're read to tell it otherwise, try setting this option to false. This means that there is one additional keystroke (Down arrow) to get an item selected, and at this point you can press your "Accept Suggestion Key".
Wrap Completion Popup Selections - Wraps selections in the completion popup once the top or bottom of the list is reached.
Default: true
Method Receiver Sort Policy - Because code completion considers all possible precedence levels when requesting completion of a partial method selector, you may see method suggestions in the popup with a left arrow or double left arrow icon.

Method suggestions with a single left arrow icon imply the suggestion is meant for an outer receiver 1 level out from the inner receiver. A completion suggestion with a double left arrow implies the completion is meant for the receiver 2 levels out from the inner receiver. The distinction is important because it makes auto-parentheses insertion an unambiguous operation. By selecting a given completion, you are simultaneously specifying the intended precedence level, and code completion will take care of where the parentheses, if any, should go.

With this overview in mind, it is now appropriate to say that this policy describes the order in which method suggestions, with the various receiver levels, will be sorted in the completion popup. The following is a description of the policies available:
Inner First - Method suggestions intended for the inner receiver will be sorted before method suggestions intended for any outer receivers.
Outer First - Method suggestions intended for the outer receivers will be sorted before method suggestions intended for the inner receiver.
Inner First Unless Binary Outer Exists - The preference here is to sort with an Inner First sort policy, unless the inner receiver is part of a (outer) binary expression, in which case an Outer First sort policy will be used.
Default: Inner First Unless Binary Outer Exists

Live Filtering Support: When the completion popup is visible in a workspace, inspector, browser or debugger, you can press <Ctrl+Shift+I> to cycle through the Inner/Outer First sort policies. When performing live filtering, adjustments to the policy will only be retained while the popup is visible. Once the popup is closed, the original policy defined by your configuration will be reinstated.

Tip: When would you use "Inner First Unless Binary Outer Exists"? While it would be difficult to formally prove, it was noticed that after requesting code completion after a binary expressions, such as "x = y", the completion suggestions of interest tended to be those that referred to the outer binary expression, rather than the inner receiver (which in this example is "y"). Of course, there are many cases where you actually want to refer to the inner receiver, and wish those would show first. If you find this to be universally true, you may adjust this sort policy to Inner First, or if it's just in a few cases, you can take advantage of live filtering and have it sorted the way you want by pressing the live filter hotkey described above.
Prefer Class Hierarchy Method Sort - If set to true, method completions for receivers, whose object type can be narrowed down to a single type, will be sorted in the popup according to the method's defining class position in the class hierarchy (ordered by most concrete to most abstract). A lexicographical sort is the standard sort policy used if not using a hierarchy sort.
Default: true

Live Filtering Support: When the completion popup is visible in a workspace, inspector, browser or debugger, you can press <Ctrl+Shift+H> to toggle between hierarchy and lexicographical sort. This will have no effect if a hierarchy sort it not possible because the receiver's object type is not narrow enough. When performing live filtering, adjustments to this setting will only be retained while the popup is visible. Once the popup is closed, the original policy defined by your configuration will be reinstated.
Enable Variable Completions - Allows you to control if completion suggestions for a variable will be shown in the completion popup.
Default: true
Enable Pool Variable Completions - Allows you to control if completion suggestions for pool variables will be shown in the completion popup.
Default: true
Enable Global Namespace Completions - Allows you to control if completion suggestions for global namespace items (Classes/Globals/Pool Dictionaries) will be shown in the completion popup.
Default: true
Enable Symbol Completions - Allows you to control if completion suggestions for Symbols and Atoms will be shown in the completion popup.
Default: true
Enable Method Completions - Allows you to control if completion suggestions for Methods will be shown in the completion popup.
Default: true
Enable Block Argument Detection - If this is set to true, then the code completion engine will attempt to identify block-arguments of a keyword method completion suggestion. If any are found, "[]" will be inserted in their associated argument positions once the completion suggestion is applied to the text editor.
Default: true
Apply Filters to Empty Partials - If this is set to true, then a single suggestion will show when requesting code completion on an empty partial. This suggestion acts as a filter so huge quantities of suggestions are not drawn which is performance intensive. Accepting this filter suggestion will simply redraw all suggestions.
Default: true
Look And Feel Configuration Options
The options in this category provide settings to customize the look and feel of code completion. With these settings, you can create a customized theme for the completion popup, as well as take advantage of match highlighting.
Assuming you use code completion, you are going to be seeing the completion popup a lot! This is especially true if you have "Auto Completion Popup Enabled". Therefore, you should have some ability to control how the popup looks...and we provide that capability with an extensive set of theming options.
Being able to control the visual appearance of the completion popup can have a lot of appeal. However, we felt it was also important to find ways to use visual appearance to help increase the usability of code completion. With this in mind, code completion offers a "Match Highlighting" engine that provides visual cues for matched and unmatched regions of a candidate completion suggestion in the popup. These visual cues allow you to quickly see why completions are in the popup, what the next character to press should be and what remaining portion of a given completion in the popup has yet to be matched.
Note: Match Highlighting functionality is only available when using enhanced list widgets with the extended list widget style, which is one of the settings provided. However, some of the basic theme settings will still be available even when you're not using enhanced list widgets.
With the exception of fonts, look and feel configuration options are designed to be shared across all VA Smalltalk supported operating systems. Fonts require some special handling because font availability is not just operating system dependent, it can also be machine dependent. Typically, you will see more font variation between the windows and *nix systems, instead of within a given family of systems. Because of this, font configurations are stored by operating system type. While this scheme doesn't solve the issue completely, it does capture the majority of cases where, for example, you need to specify one type of font for a Linux client and another type of font for a Windows client. Even though the font setting is stored by operating system type, there are certainly situations where a specified font may not be available. For example, if you specify your font setting for code assist in a Windows 7 client, with a font only available in Windows 7, and then open a Windows XP client connected to the same ENVY manager (and as the same ENVY user), upon opening the Look And Feel configuration options for Code Completion in Windows XP you will see that it falls back to using the 'Default' font for that particular font setting. Additionally, you will see that 'Default' is drawn in red, so you will be aware that it was unable to locate the specified font. At this point, you may just go with the default, or you may wish to change the font to one that is available on Windows XP and Windows 7.
The pictures below show some examples of different combinations of theme and match highlight settings. Some of these would probably be ridiculous choices in practice, but it demonstrates some of the visual elements you will have control over:



All the settings related to look and feel are described in detail below:
Use Enhanced List Widgets - Controls if the code completion widgets will be using enhanced list widgets. Enhanced list widgets will always be available for use because they are a core part of the development environment (ExtendedWidgets). The fundamental reason this choice was made available is that, by default, code completion tries to maintain the look and feel of the VA Smalltalk environment. If the development environment is not using enhanced list widgets, then by default, neither will code completion. This setting is provided so you are free to override whatever the default is.
Default - Defers to the global setting of the environment "Use Enhanced List Widgets" to determine if enhanced list widgets should be enabled.
true - Use enhanced list widgets
false - Do not use enhanced list widgets
Default: Default
Enhanced List Widget Style - The code completion list widget style to use.
Extended - Completion list widget is drawn using VA Smalltalk's Extended Widget's framework
Scintilla - Completion list widget is drawn and managed by Scintilla.
Default: Extended
Max Visible Suggestions - The maximum number of visible suggestions to display in the completion popup. This effectively determines the height of the popup and will be constrained by the overall height of the screen.
Default: 10
Completion Popup Layout Policy - This policy describes the placement of the completion popup.
Align with Text - When the completion popup is shown, it will anchor itself to the starting location of the partial string the user has entered. Even as the user types additional characters, the popup will maintain its initial location.
Align with Cursor - When the completion popup is shown, it will show relative to the cursor's current location. As the cursor moves, the completion popup will move with it.
Default: Align with Text
Completion Popup Font - The font used for completion suggestions that are rendered in the popup, unless overridden with matched/unmatched region font settings. If "Default" is specified, then the text editor font will be used.
Default: Default
Completion Popup Background - The background color used for the completion popup (non-selected region). The default color will be the enhanced list widgets color defined for the system by VA Assist Pro. If this is not set, then the default background will be white.
Default: Default
Completion Popup Foreground - The foreground color used for the completion popup (non-selected region). The default color will be the computed inverse of the "Completion Popup Background" color.
Default: Default
Selected Suggestion Background - The background color used for a selected suggestion in the completion popup. The default color will be the selected background color defined by the system. (see CwList>>selectionBackgroundColor)
Default: Default
Selected Suggestion Foreground - The foreground color used for a selected suggestion in the completion popup. The default color will be the selected foreground color defined by the system (see CwList>>selectionForegroundColor)
Default: Default
Enable Match Highlighting - If set to true, then completion suggestions rendered in the popup will be stylized according to the settings described below.
Default: Default
Matched Region Font - The font used for regions of a completion suggestions that match the current partial string in the text editor. If "Default" is specified, then the "Completion Popup Font" will be used.
Default: Default
Matched Region Color - The color used for regions of an unselected completion suggestion that matches the current partial string in the text editor. If "Default" is specified, then the "Completion Popup Foreground" color will be used.
Default: Default
Selected Matched Region Color - The color used for regions of a selected completion suggestion that matches the current partial string in the text editor. If "Default" is specified, then the "Selected Suggestion Foreground" color will be used.
Default: Default
Unmatched Region Font - The font used for regions of a completion suggestions that have yet to matched by the partial string pattern. If "Default" is specified, then the "Completion Popup Font" will be used.
Default: Default
Unmatched Region Color - The color used for regions of an unselected completion suggestion that are still unmatched by the current partial string in the text editor. If "Default" is specified, then the "Completion Popup Foreground" color will be used.
Default: Default
Selected Unmatched Region Color - The color used for regions of a selected completion suggestion that are still unmatched by the current partial string in the text editor. If "Default" is specified, then the "Selected Suggestion Foreground" color will be used.
Default: Default
Highlight Distinct Matched Regions - If set to true, then matched regions in a completion suggestion will be highlighted independently of each other. This can be a useful visual cue to show completions that have been prefix or camel-case matched. If set to false, then all the matched regions will be combined into one contiguous match region.
Default: false
Highlight Next Character To Match - If set to true, then an underline will be rendered under the next character to match in a given completion suggestion. This could also be interpreted as underlining the first unmatched character in a given completion suggestion.
Default: true
Code Completion Suggestions
In VA Assist Pro, code completion provides you with a set of "suggestions" for completing the word that you're typing. These completion suggestions come in various flavors to help you complete the different constructs available in the Smalltalk language. Code completion in VA Assist Pro is context sensitive, and can use the information from the current context to provide you with relevant suggestions. For example, if you are typing a method selector and activate code completion, it knows to only provide you with selectors that successfully complete what you're typing, and not classes and variables that happen to match your partial selector. Code completion provides suggestions to you with icons to help you quickly identify what to look for. The following is the list of constructs that can be completed, along with examples of their associated icons. In many cases, the code completion engine is able to identify the type of the object being suggested dynamically (i.e. Number, String...), and will use the icon associated with that type.
Pool Variables (Uses Dynamic Icons)
Pseudo Variables (self, super, nil, true, false)
Globals (Uses Dynamic Icons)
Methods (Uses Dynamic Icons)
Most suggestion types are self-explanatory for a Smalltalk programmer, however there are a few suggestion types that are worth describing in more detail.
Symbol Suggestions: VA Smalltalk's code completion has support for completing symbol literals. Suggestions for symbol literals are created from the Smalltalk symbol table, which is often very large. While code completion is more than happy to show you all symbols available in the system, you should understand that this is a pretty expensive operation and will take some time (which implies a second or so, instead of 100 milliseconds). You can see all symbols in the system by typing '#' and requesting code completion. You will notice that a filter notice will popup. At this point all the symbol suggestions have been prepared, they just have not been rendered in the popup yet. You may either accept the filter notice to show them in the completion popup, or you can just continue to type and it will filter on the prepared items and show the filtered suggestions in the completion popup.
Character Literal Suggestions: One of the goals of code completion is to show useful information in the completion popup at all points. While you certainly don't need assistance in typing a single character, it may be useful for you to see a set of suggestions that describes the ASCII table. This can be achieved by typing '$' followed by a request for code completion. What you will be looking at is the non-extended ASCII table, in suggestion form, and you will be able to search by name or ASCII value. This is also helpful for completing some of the non-printable characters, which are usually referenced by pool variables. Code completion is aware of what pool variables are visible in your current context and will provide a full scoped reference to a character pool variable if necessary. The following shows an example of what character literal suggestions look like.
Method Suggestions: Code completion has a unique ability to display suggestions for all possible receivers of a method. Visual cues are provided in the completion popup that allow you to tell which receiver a completion suggestion refers to. Once a method suggestion is accepted, code completion will not only apply the completion to the editor, but also auto-insert parentheses where needed. Code completion is able to do this because the selection you make tells it what the intended precedence level is, and therefore where parentheses need to be inserted so the completion will refer to the intended receiver. The following picture below shows an example of the completion popup containing method suggestions for all three precedence levels to complete the partial 'aft'. The first suggestion is a camel-case match that refers to the variable receiver 'max'. The second suggestion is a camel-case match that refers to the binary expression receiver 'min < max'. We know this because there is one yellow left arrow icon to indicate that this completion is for the receiver one level out. Finally, we have two prefix-matched suggestions that refer to the receiver 'OrderedCollection new'. Notice that there are two yellow left arrows for these suggestions, which specifies that it is intended for the receiver two levels out.
Text Manipulation Suggestions: Some other VA Assist Pro features, such as refactoring, hook into code completion which can make it easier to initiate the refactoring. Some examples of this are generating accessors and declaring an undefined temporary. These are discussed in more detail in the Refactoring section below.
Effective Search using Code Completion
Code Completion has powerful matching algorithms that allow you to narrow down the completion list to just the completions you are interested in. This section will walk through the matching algorithms that are available in VA Smalltalk and describe how they work so you can search most effectively.
When completion matching is talked about, what is implied is that the user has typed a small part of a larger name that the user would like assistance completing. The part that the user has typed in will be referred to as the 'partial string'. Code completion will attempt to match the partial string against longer names that might be suitable candidates for completion. These longer names will be referred to as 'candidate completions' and these are the items that the user sees in the completion popup.
A key point to understand is that the partial string represents a pattern, and it is up to the matching algorithms to understand how to interpret that pattern. Most developers who have used code completion with other development environments are pretty comfortable with the fact that the partial string typically represents the prefix of the intended completion. So for example, if a developer wanted to complete the name 'OrderedCollection', they may type 'Ord' and request code completion with the expectation that 'OrderedCollection' will be an available candidate completion (and therefore will be an item in the completion popup). While this remains true, we will also see that VA Smalltalk has matching algorithms that interpret the partial string as a pattern that describes more than just the prefix of an intended completion. This leads to more powerful searching capabilities, but these matching algorithms have their own rules which you must learn in order to use them most effectively.
Prefix Matching: Prefix matching implies that the partial string represents the prefix of an intended completion. Therefore, the candidate completions that are successfully matched using this method will have the partial string as their prefix.
In VA Smalltalk, you have the option of specifying that prefix matching is case-sensitive or case-insensitive. While case-insensitive means you don't have to press the <Shift> key to match uppercase characters, the trade-off is that you will most likely see more candidate completions in the popup since there may be both uppercase and lowercase matches.
CamelCase Matching: VA Smalltalk supports a powerful multi-mode algorithm that interprets the partial string as a pattern which can be used to match names that conform to the rules of camel case. The camel case rule set is only loosely-defined, but fairly easy to understand with some examples which will be provided. The algorithm has a few modes which can be decided by you. See the 'CamelCase Match Policy' configuration section for more information.
CamelCasing is a way to represent multiple words or phrases as a single word. This is done by removing the spaces between the discrete words, which joins them together, and then taking the first letter from each word and making it an uppercase. This last step is so you can visually tell the separation between the words since spaces are no longer present. This is far easier to describe with some simple examples, and if you program in Smalltalk, you are probably very comfortable with this concept already. Consider the Smalltalk class name 'OrderedCollection'. In this example, the adjective 'Ordered' has been joined with the noun 'Collection'. Notice that the 'C' in 'Collection' is uppercase. This uppercase character is often referred to as a 'Camel hump' in a CamelCase name. These 'Camel humps' are used as part of the partial string to specify to the algorithm that if a prefix match fails at a certain character, then jump to the next 'Camel hump' and try to continue from there. Lets look at some examples. On the left will be the pattern, or the partial string that the user has typed into the text editor. On the right will be one potential candidate string that could match the pattern:
OrdCol -> OrderedCollection
OC -> OrderedCollection
ReWStr -> ReadWriteStream
mVar -> myVariable
As you can see, the partial strings are much smaller, but also convey a lot more information than just simple prefix matching. VA Smalltalk takes it even one step further. Notice in the above examples that the user must type an uppercase character in the pattern to represent the 'Camel hump' of a CamelCase name. This means pressing the <Shift> key a lot in short succession. VA Smalltalk will happily use this rule set, but the user may also adjust the CamelCase matching policy to 'Lenient' and let Code Completion figure out where the 'Camel humps' are supposed to be. By doing so, the above example could be modified as follows:
ordcol -> OrderedCollection
oc -> OrderedCollection
rewstr -> ReadWriteStream
mvar -> myVariable
The CamelCase matching algorithm also provides a unique way to search Smalltalk keyword selectors. Typing the ':' is completely optional, and multi-keyword selectors can be searched using CamelCase. The following are some examples shown using the Lenient variant of the algorithm:
aoc -> asOrderedCollection
asorcol -> asSortedCollection:
adafin -> add:afterIndex:
a:beind -> add:beforeIndex:
wwww -> with:with:with:with:
 
Enhanced Breakpoint Management
VA Assist's enhanced editor provides a fresh new look and feel for breakpoint management. The enhanced editor has a persistent breakpoint margin on the left in all enhanced browsers and debuggers. Breakpoints are visualized not only by more modern icons, but also in the editor itself where breakpoint expressions are color highlighted. This comes in handy when the user adds two or more breakpoints to the editor. The effect is shown in the picture above.
Breakpoint Icons (Default Theme)
- Active Breakpoint
- Deactive Breakpoint
- Multiple Active/Deactive Breakpoint (Used for multiple breakpoints on a line with different active/deactive states)
- Disabled Breakpoint
Adding Breakpoints
The user can quickly add a breakpoint to a given line by double-clicking the breakpoint margin bar at the line's horizontal location. It's even easier to add zero configuration one-shot breakpoints (these are breakpoints that disappear after they are triggered). This can be accomplished by double-clicking the margin bar while holding the <Ctrl> key down.
The user can also add breakpoints by right-clicking the breakpoint margin bar and making a selection from the resulting context-menu. Additionally, the user may place the text cursor at a location in the source code and, by right-clicking, bring up a context-menu from which they can add a traditional or one-shot breakpoint.
Configuring Existing Breakpoints
If the user wishes to reconfigure a breakpoint, they only need to double-click the breakpoint icon in the breakpoint margin to bring up a configuration dialog.
If there are two or more breakpoints on a given line, double-click is reserved for cycling through the breakpoints to choose the selected one. Once the appropriate breakpoint is selected, the user can right-click that breakpoint, to bring up a context-menu, and choose "Configure Breakpoint" from the "Selected Breakpoint" submenu.
Deactivating Breakpoints
Deactivating breakpoints can be accomplished through context-menus, or the user can simply double-click a breakpoint icon while holding the <Shift> key down.
Removing Breakpoints
Removing breakpoints can be accomplished through the context-menus, as well. However, a quicker way is to double-click the breakpoint icon while holding the <Ctrl> key down.
Code Analytics
VA Assist Pro provides a sophisticated code analytics engine, which is designed to Detect, Report and Repair issues with source code. Furthermore, the code analytics engine is designed to run in real time, constantly analyzing the code in the background as the user types.
Detecting
Code Analysis works against a set of known lint rules which are checked as changes to the source code are detected. Each rule has a default classification, but these classifications can be adjusted by the user. The classifications are:
Disabled - The rule will be skipped
Fatal Error - Highest Severity. An example of this is a compiler error.
Error - High Severity. An example of this is an unknown selector that is saved into a method. The method can still be saved, but it is usually a good indication that something is wrong.
Warning - Medium Severity. An example is a variable whose value is read before it has been assigned to. Unassigned variables are implicitly nil so it's not an error, but it is probably a good indication that something is amiss.
Info - Low Severity. An example is a variable that could be pushed to an inner scope.
The following is a list of rules with their default classifications:
Compiler Error - An error within the source that keeps it from compiling. Classification: Fatal Error
Unimplemented method in system - A selector referenced within the code is not implemented in the image. This could be because the appropriate code is not loaded or it may be a spelling mistake. Classification: Error
Unimplemented method in receiver - A message selector exists in the image, but it has been determined that the receiver of the message does not implement it. Classification: Error
Class/Method not visible in application - A reference to a class or a message selector is not visible in the application prerequisite chain. This can cause errors when packaging because the packager relies heavily on the prerequisite chain to know what can be stripped out of a reduced image. This is also an early warning sign of a disorganized code base. Classification: Warning
Variable is unused - A temporary is defined but never used. Classification: Warning
Variable read before written - The value of a variable is read before it is ever assigned to. Classification: Warning
Variable written but never read - A variable is assigned a value (or multiple values) but the value is never used. Classification: Warning
Variable can be pushed to inner scope - A variable could be defined in a more local scope. Classification: Info
Reporting
Issues that are detected must be reported to the user. When using real time code analysis, this should be done in a subtle way so the user is not distracted while coding and can choose to address the issues when he/she is ready.
The first part to reporting is decorating the affected section of text. This is typically done using an indicator that is drawn underneath the text and is shaped and colored according to the specification of the editor theme. Additionally, a marker of the same color is placed in the margin area (left part of the editor) on the same line as where the issue occurred. This allows the developer to quickly find issues when scrolling vertically.
While indicator visualizations show where an issue exists, it does not detail what the issue is. Calltips are used to do this. The developer simply hovers the mouse pointer over an indicator for a short period of time (@300ms) and a calltip will appear with a short description of the issue.
Repairing
Repairing is taking action against the reported issue in order to resolve it. There may be more than one possible action to take. Before a repair can proceed, the possible list of actions need to be presented to the user. VA Assist Pro accomplishes this with what are called "Action List Calltips". Action list calltips are calltips that can be interacted with like list widgets and allow the user to select from a series of "Actions" to apply.
Furthermore, action list calltips start off in a collapsed state so they resemble a regular calltip. The following action list calltip below is in its collapsed state. An action list calltip can be distinguished from regular calltips by the down arrow button on the left side:
Clicking the down arrow button expands the calltip. The user can now select the appropriate action using the up/down arrows on the calltip or keyboard. The user can apply the action by double-clicking the calltip or pressing <Enter>:
Invoking a repair is considered refactoring. The available types of refactoring will be described in a subsequent section.
Code Analytics Configuration Options
Code Analysis configuration options can be accessed by (Options | Code Assist | Configure...) in any browser menu and selecting "Code Analysis" from the Feature combo box in the Configuration UI.
The following is a description of all configuration options:
Enable Incremental Compiler - Enable/Disable real-time compiler error indication.
Default: true
Show Margin Markers - Enable/Disable the use of markers in the margin to indicate annotated source.
Default: true
Unimplemented method in system - Classification of lint rule that detects if a selector is implemented anywhere in the image.
Default: Error
Unimplemented method in receiver - Classification of lint rule that detects if a selector is implemented by the receiver.
Default: Error
Class/Method not visible in application - Classification of lint rule that checks the prerequisite visibility of references to classes and message sends.
Default: Warning
Variable is unused - Classification of lint rule that checks for declared temporaries that are never referenced.
Default: Warning
Variable is read before written - Classification of lint rule that checks for variables whose value is read before an assignment occurs.
Default: Warning
Variable is written but never read - Classification of lint rule that checks for variables that are assigned values but are never used.
Default: Warning
Variable can be pushed to inner scope - Classification of lint rule that checks for variables that could be defined in a more local scope.
Default: Info
 
Refactoring
Refactoring is an important part of the coding experience. Continuous improvement to the code base by changing internal or external structure is considered favorable in modern software development. Smalltalk has a strong history in refactoring and VA Smalltalk includes a separate feature called the "Refactoring Browser" that includes a complete framework for performing this task.
VA Assist Pro incorporates a subset of these refactorings in order to satisfy the "Repairing" aspect of Code Analytics. These refactorings involve changes to internal structure within a method context. There are many other kinds of refactorings that deal with external structure (i.e. Rename a class, Rename a method) that VA Assist Pro does not address. Because of this, the "Refactoring Browser" still has its place and is a worthwhile feature to use.
Integrating into the Code Analytics workflow is a first step, but VA Assist Pro also optimizes that workflow using more interactive mechanics to accomplish refactorings. Traditionally, popup dialogs were used to provide the workflow for refactoring. For example, on an activation of a "Rename Temporary" refactoring, the developer would most likely be presented with a popup dialog asking what the new name of the temporary should be. After specifying a name, the developer would press an ok button and the declaration and all references to the temporary in method would be renamed. Enter a name and press ok...this doesn't seem to bad, right?
There are a couple of issues with this rigid workflow. The first is that the example only demonstrates the happy path. What if the new name is already taken by another visible temporary, argument, instance variable (...and so on)? What if the developer wants to quickly try a few names to see how the resulting source code looks? Popups hurt usability in these cases because they force the developer to switch contexts...meaning that it takes them away from the code. So is there a way to do this without switching contexts, even with unhappy paths? The answer is yes, but it requires more advanced visualizations that are not often available in editors, but can be found in VA Assist Pro!
The following is a description of refactorings implemented by VA Assist Pro:
Correct Spelling
Code Analytics will identify selectors used within a method that are not implemented in the system. One of the reasons for this is that the selector may be misspelled. This refactoring allows the developer to pick the correction from a list of possible choices and apply to correct the spelling.
How to activate
Action List Calltip: This is the repair for an "message not implemented" report.
Menu Item: Place the text cursor on the message selector that you want to correct. Bring up a context menu and activate "Correct Spelling" (Content Menu | Correct Spelling)
Instant Rename
Instant rename allows the developer to select a local variable and rename it in a scope sensitive manner. This will include the local's declaration and references. As can be seen in the picture above, the 'newCollection' temporary has been selected for instant rename. The declaration and references that are to change can be quickly visualized. To rename, just begin typing and press <Enter> to accept...that's it. As you type each character, the change will be reflected in the editor.
What about the unhappy path? Lets rename 'newCollection' again, but this time it will be renamed to 'element'. Notice that there is already a block argument named 'element' so this is going to cause a conflict.
Wow, it looks like the conflict detection system kicked in. There are a few parts to conflict detection in this case:
How to activate
Menu Item: Place the text cursor on the temporary that you want to rename, it is not necessary to select the temporary. Bring up a context menu and activate "Instant Rename" (Content Menu | Refactoring | Instant Rename)
Shortcut: Place the text cursor on the temporary that you want to rename, it is not necessary to select the temporary. Press the "Instant Rename" shortcut <Ctrl+Alt+R>
 
Remove Unused Temps
Code Analytics is able to detect temporary variables that are declared, but never used. The repair action for this is the "Remove Unused Temps" refactoring that is available from the expanded action list calltip when hovering over a temporary declaration.
This happens frequently as a result of refactoring and simplifying code within a method. For example the developer may decide to inline some method calls whose result was previously assigned to a variable, but forget to remove the declaration. Because more than one unused temp is so frequently seen together, there is an option to do this refactoring in bulk mode where all unused temps are removed at the same time.
Every temporary declaration that is to be removed will have a box drawn around it. Part of the spirit of the interactive workflow is to allow the developer to always see what is impacted.
How to activate
Action List Calltip: This is the repair for an "unused local" report
Push Down Local
Code Analytics is able to detect temporary declarations that could be pushed into a more localized scope. The repair action for this is the "Push Down Local" refactoring that is available from the expanded action list calltip when hovering over a temporary declaration.
Pushing down a temporary will start a new interactive workflow (as shown below). See the "Locals Relocation Workflow Mechanics" section below to see how to use the workflow.
How to activate
Action List Calltip: This is the repair for a "local can be pushed to inner scope" report.
 
Declare Temporary Variable
This is one of the most exciting and useful refactorings that VA Assist Pro offers. It uses the "Locals Relocation Workflow Mechanics" (described below) and allows for a simple interactive way to declare undefined variables with minimal context switching.
In the example shown above, the developer:
 
How to activate
Menu Item: Place the text cursor on the temporary that you want to declare, it is not necessary to select the temporary. Bring up a context menu and activate "Instant Rename" (Content Menu | Refactoring | Declare Temporary Variable)
Shortcut: Place the text cursor on the temporary that you want to rename, it is not necessary to select the temporary. Press the "Instant Rename" shortcut <Ctrl+Alt+D>
Action List Calltip: This is the repair for an "undefined" report.
Code Completion: Request code completion after the undefined token. This will show a suggestion that asked if you want to declare as a temporary variable. Press Enter to accept
 
Locals Relocation Workflow Mechanics
The workflow mechanics are shared by all refactorings that relocate temporaries. During this workflow, all edits are being tracked as a single undo operation. This is because moving a temporary from one location to another is a Delete/Insert from the editor's point of view.
The following is a description of the parts and mechanics.
Smart Text Prompters
All of the system text prompters have been enhanced to remember previous entries. For example, the Browse Implementors, Browse Senders, Browse Classes, etc. commands from the Transcript will now remember the all prior entries. This makes it very easy to duplicate queries repeatedly without undue typing. Likewise, the version name prompters will remember prior entries so that you can quickly apply the same version names to other classes or applications. Each text prompter keeps its own list of entries (so that the version name entries don't show up in Browse Implementors and vice versa). All of the lists may be cleared by selecting the Clear Prompter Suggestions command from the Power Tools setup window.
The Smart text prompters may be customized via a built-in settings menu. The settings menu allow you to control whether the prompter autofills (e.g., guesses based upon the user's input), whether the autofilling is case sensitive, and whether the prompter should suggest an answer if the system does not suggest one.
Version Name Templates
The version name progression used by default in VA Smalltalk is very simplistic. Essentially it increments the last number or letter of the previous version name. Many development teams would like to standardize on more sophisticated version naming schemes (possibly taking into account the current date, the user's name, initials, etc.). A custom version name template editor is provided which may be used to specify the desired version name template. Pre-existing templates may be used or new ones created. When switching between templates, the system will automatically extract any numeric version information and reformat it to the new desired template. The version templates may include any character and any of the following tokens (in any order):
For example, a template defined as “[%I - %D] %V” would result in version names that look like “[LS – 8/1/99] 1.2.3” (assuming that the user is the Library Supervisor). If the template contains the %D token, the current date is inserted using the current date template (also definable using the version name template editor).
Super User Status
(Application Manager, Configuration Maps Browser, Application Editions Browser)
When Super User mode is turned on, you can bypass ENVY security to do anything you want. Almost all of the menu commands are affected. For example, you can version classes that you are not the developer of; you can release classes that you are not owner of; you can version applications that you don't manager; you can copy, move or delete classes that you do not own; etc.
Note that when you act on an entity owned by someone else, ENVY is fooled into thinking that the activity was performed by the someone else, not the current user (this is a requirement of low level ENVY security).
It goes without saying that you should use this mode with caution and only with the permission of the other member of your group. That said, this mode is quite fun and very useful. It beats the heck out of “changing users” every time you want to do something to an entity that you don't own.
Since Super User mode is a flagrant violation of the ENVY security model (and therefore scary to managers who want to enable all of ENVY's security features), we have compromised and added a bit of the security back in. In order to turn the Super User mode on and off in an image, the “Allow Special Features” setting in the VA Assist Pro Transcript menu must be turned on. Only the Library Supervisor can do this. Once turned on, the owner of the image can turn the feature on and off. If you already are Library Supervisor, you don't have to do anything special. If you work in an environment where ENVY security is turned off, you just need to temporarily switch users to Library Supervisor long enough to toggle that setting.