ModelMaker Code Explorer 4.21

New features

  • Redesigned "Use Unit" dialog (pascal). This lists all units found in project, project search path, IDE library path, IDE Browsing path making it easier to pick a unit to use. Additionally the previously units added through this dialog but not found on the search paths are displayed. The dialog also allows just opening the selected file(s). The Options tab allows selectively disabling search paths.
  • The shortcut list editor as for example used in Properties | Keybindings and the Action List Wizard, allows sorting on command name.
  • Visual Studio: Visual Studio style images can be used rather than the ModelMaker Tools style images. Adjusted on Properties | General | Display options.
  • Visual Studio: new option Select default Class on Properties | General tab. If enabled, the cursor is positioned on the first class in a module after opening a source file. Default enabled.
  • Toolbars shrink mode can be adjusted (wrap or chevron style) - Shrink mode in the toolbar's pop up menu.
  • Add Class (interface, descendant etc) pick up the word at cursor as a suggestion for new class name. Used for example when adding a new class based on method return type or parameter type
  • Pascal: If the editor cursor is a class interface, Add Method and Add Property use the visibility based on the cursor position.
  • "Convert to const" allows (multi line) expressions instead of just strings and numbers. To convert an expression instead of the current token, select the expression before invoking Convert to const.
  • Members view Navigation | Clear Favorites allows clearing all favorites or all favorites in the current module.
  • Most multiple selection commands now work in Module Search mode, including Delete, Copy, Paste, Change Visibility, Drag drop copy/move members.
  • Member Search Bar edit has Auto Complete style, remembering previously entered search texts. Available for Delphi 6 and up
  • Module Search available as command in MMX menu. If option "automatic invoke module search" is disabled this allows entering module search mode from inside the IDE editor without having to click the Module Search node in the explorer tree.
  • Attribute presets can now be organized in a hierachy and are edited using the template editor (similar to surround with template).
  • Delphi 2005/2006: Auto Unfold collapsed sections mode adjustable (previously fixed unfold module). New "Unfold at cursor only" mode only unfolds those sections required to see the cursor - this is now the default mode. Adjust on Properties | General.
  • Delphi: When looking for a pascal class or interface type, MMX optionally checks the loaded win32 packages in addition to the parsed modules. Configured on Properties | General, default is enabled.
  • Pascal: rename local is now available anywhere in a unit. The default rename scope is adjusted depending on the cursor position.
  • Pascal: if the parser detects a method implementation with different parameter list than the interface, it emits an error.
  • Pascal: Several features for method implementations without declaration are now enabled: Delete, Edit (auto inserts missing declaration), Rename, Convert To Property and more.

Live Metrics™

  • Optionally MMX displays Live Metrics™ hints in the contents (classes) view to help locating potential problems. Metrics hints are grouped by category as sub nodes for a "Live Metrics" node. The detailed hints are displayed in the Members view. Pascal example: open example VCL Classes.pas and see how hints are emitted for long methods etc. Checked metrics are controlled on the Properties | Metrics Tab.
  • Long Methods: Long methods can be a sign of code duplication. Usually long methods can be refactored using Extract Method or Replace Method with Method Object. If enabled, hints are emitted for methods longer than ## (user definable) lines.
  • Long parameters lists: Long parameters lists can be an sign for complicated methods or code duplication. Usually complicated methods can be refactored using Extract Method. Long parameters lists can be replaced with Introduce Parameter Object. If enabled, hints are emitted for methods having more than ## parameters.
  • Many nested procedures (pascal): Nested procedures can be an sign for a method that should be converted into a class using Replace Method with Method Object. The nested procedures then become normal methods. If enabled, hints are emitted for methods having more than ## nested procedures.
  • Magic numbers: Magic number are number literals other than 0 and 1 These can cause problems when modifying an application. If enabled, hints are emitted for methods that contain number literals other than 0 and 1. The Members view allows converting the selected number to a constant using the "Convert to constant" refactoring.
  • Hard coded strings: Hard coded strings can cause problems when localizing and translating an application. If enabled, hints are emitted for methods that contain hard coded strings. The Module String scanner string scan filter is used to determine if a string is a hard coded string or not. The Members view allows converting the selected string to a resourcestring (pascal) or to constant. Alternatively the source lines containing the strings may be marked as "not localized" - similar to how the Module string wizard does this.
  • TODO items: If enabled, comments starting with
    TODO [[ ] [-] [:]] are displayed, acting as an in-place TODO list.
  • The existing Sorting Hints, Void class interface sections and Wrapped declarations hints now appear under the Live Metrics node.

Alternative Navigate Up/Down

Pascal: An alternative for navigation Up/Down (Ctrl+Shift+Up/Down) is available through MMX keybindings. In addition to navigating on non-method entities (properties, uses clause etc.) "Up" on method declarations invokes special logic, "Down" on method implementations invokes special logic. The following features are supported:

  • Fault tolerant Method declaration / implementation toggle. The MMX parser is more fault tolerant than the IDE parser when dealing with code containing syntax errors.
  • Property navigation: Up on a property declaration navigates to the setter method declaration (if no setter is used to the getter). Similar, Down navigates to the setter (getter) method implementation.
  • Access method navigation: Up on a property getter/setter access method declaration navigates to the "other" access method declaration. If not "other" access method is used it navigates to the property declaration. Similar, Down on a property getter/setter access method implementation navigates to the "other" access method implementation.
  • constructor / destructor navigation: Up on a constructor / destructor declaration navigates to the next constructor / destructor declaration (circular). Similar, Down on a constructor / destructor implementation navigates to the next constructor / destructor implementation (circular).
  • Uses clause navigation: Up / down invoked on a uses clause toggles between the interface / implementation uses clause.
  • Module Section navigation: Up / down invoked on a module section [interface|implementation|initialization|finalization] navigates to the previous / next module section (circular).

The existing "Toggle Accessors" has been removed and is replaced by the property accessor navigation.

For Delphi 7 and higher the Ctrl+Shift+Up/Down keybindings are used, effectively replacing the default IDE behavior.
Delphi 5/6 do not allow replacing the IDE keystrokes. Here you could manually assign any free shortcuts to the MMX Navigate Up/Down commands (Properties | Keybindings).

Alternative Method Property editor for the Win32 Object Inspector

Borland IDEs: An alternative method property (events) editor for the Object Inspector is available (default = active). The Method Property editor is used by the Object Inspector to create and rename event handlers for component events such as Button.OnClick. If the MMX alternative is active, it enables the following features:

  • MMX logic for method insertion position is invoked: sorted on name or appended. Controlled on Win32 eventhandler options tab, which has separate options for interface and implementation insertion mode.
  • MMX line wrap settings are used
  • Auto complete used units is invoked (if enabled on Pascal | Editing)
  • The default event handler name can be adjusted by defining a concatenation string. This allows creating for example Button_Click instead of ButtonClick)
  • Renaming event handlers through the Object Inspector (optionally) invokes MMX IntelliReplace.
  • Type names as (re-)defined in the Type Selector are used rather than default IDE values. For example "string" i.s.o. "String"
  • MMX offers to set read-only editor buffers to read-write when double clicking in the Object Inspector.
  • A ToDo item comment is (optionally) inserted in the new method body

Delphi 6 note: In all IDEs except Delphi 6 the MMX alternative is auto-deactivated if other 3rd party tools or component providers install a specialized method property editor - for example DevExpress installs a method editor for nested events. The Delphi 6 IDE causes AV's in this 3rd party replacement detection mechanism. For Delphi 6 it is therefore disabled. If you have a collision with 3rd party components such as DevExpress events, you have to fully deactivate the MMX method property alternative.

The MMX Method Property editor is (de-)activated and configured on tab Properties | Pascal | Win32 Eventhandlers.

Source Indexer - Find ALL identifiers (whole words) in files

Source Indexer is an alternative for the IDE Find In Files | Whole words search. It finds ALL words at once. The indexer takes a list of directories to scan and builds an index of all identifiers in the scanned files. Building the index takes approximately. twice as long as a single IDE Find In Files. Once the index has been build, searching for any identifier is virtually instant. Source Indexer can be found under the main MMX menu | Tools and has the following features:

  • Search in multiple directory trees - separate paths with ";" (omit quotes)
  • Borland IDEs: Search in current project search path, all project search paths, library path and browsing path.
  • Skip or include comments and strings while searching - controlled by language mode: plain text, Pascal or C#
  • Optional Case sensitive search
  • Search results are displayed in a tree - details are grouped per file. The IDE editor can be scrolled to the search position
  • Pressing the space bar in the Source Indexer tree navigates to the match position and then returns focus to the indexer.
  • The Indexer window is a dockable window, it can be saved in IDE desktops. Borland IDEs warning: there are several problems with Borland IDE desktops causing 3rd party dockable windows to disappear or to be shown as empty panes. If the indexer appears as an empty pane, reload the desktop until it is visible. Do not save the desktop in this error state.
  • Optionally the indexer can automatically rebuild the index after start-up.
  • Note: after the index has been rebuild, the found identifiers are assigned to the search edit drop down list. During this time the IDE appears "dead". If you this "dead" time is too long for convenience, you can suppress loading the identifiers in the drop down. To do this, shut down the IDE and start reg edit. In "HKEY_CURRENT_USER\Software\ModelMaker\MideX\4.0\SourceIndexer\Delphi 7" (or whatever your IDE is) you'll find a string value named "AssignToCombo". Change the string value to "False" to suppress loading the identifiers and restart the IDE.

Live Documentation changes

  • Select all (Ctrl+A) available in documentation pane.
  • The Properties | General | Documentation tab has a new option per language profile: "Pick up any style comments as Documentation" (Default enabled). If you disable this, only comments with the documentation signature are picked up. Other comments - except OneLiners - are skipped.
  • New system templates may be defined for void methods and procedures:
    system.Default_Template.Method.void
    system.Default_Template.Procedure.void
    These can be used to expand a different template for void methods than for non-void methods. These templates are inserted in new setups, but do not exist for existing installations. If you wish to specialize void methods, you'll have to aad these manually under the system group.
  • Pascal: Messagehandlers like procedure WMPaint(..); message WM_PAINT; no longer emit the message identifier as return type
  • Documentation editor and tabs paste formatted text as plain text.

New location for settings

To enable Vista compatibility, MMX no longer stores settings files in directory [mmxinstalldir], which is typically some Program files sub directory. Instead, MMX now uses the User-AppData and User-Local-AppData directories. Typically:
C:\Documents and Settings\{%username%}\Application Data\ModelMakerTools\Code Explorer\4.0
and similar for Local App Data. At startup MMX automatically copies existing settings to the appropriate AppData directory.

To be fully Vista compliant, the ModelMaker Tools Shared Directory must be moved too. This involves adjusting the registry. As there's no need on existing systems to do this, MMX leave the Shared Directory unchanged. New installers will *on clean machines* automatically suggest {%UserAppData%}\ModelMakerTools\Shared rather than the current {%programfiles%}\ModelMakerTools\Shared

Yes, this spreads files all over the HDD, but that's the way to go according to Microsoft.

Related: settings are now stored immediately whcn cliking the Properties dialog OK or Apply button.

Solved bugs

  • Borland IDEs: An AV would occur when docking the MMX Action Bar with AutoHide enabled. Solved.
  • Tip of the day would not auto-increment after some time. Solved.
  • Pascal: Resolving overloaded methods would in some cases link the wrong declaration with implementation if some methods were not implemented.
  • Use the keyboard to scroll the shortcut list editor as used in Properties | Keybindings and Action List Wizard, would assign the navigation keys as shortcuts. Solved.
  • Delphi 2006 Win32: parser did not support operator overloading on records. Solved
  • Pascal: Add Procedure did not drop bookmark on the new procedure implementation. Solved
  • Pascal: A delegate defined locally in a method or procedure would appear in the members view as child of the module. Solved.
  • Pascal: Renamed Parameter would not be propagated if just the char-case was changed. Solved.
  • Several features using search paths (such as the Linked Module Analyzer) would not resolve custom environment variables in paths like ($PROJECT)\Source. Solved.
  • Live Documentation would allow starting editing documentation for Pascal nested procedures, but could not commit changes. Solved, editing nested procedures documentation is now blocked.
  • Pascal: Navigation history for global procedures would usually navigate to the declaration, even when the implementation was added to the history. Solved
  • Delphi 2005/2006: comments using multi byte character sets in the documentation window would appear bad in the IDE editor due to MMX and the IDE using different text encodings. Solved
  • Delphi 2006: class / record helper dialog would not accept an empty ancestor. Solved.
  • MMX-VS: The splitter position would not be saved between sessions. Solved.
  • Restoring the explorer treeview state after reparsing could select the wrong node with the same name. For example a namespace ABC instead of the class ABC, or an interface reference ITest instead of the actual interface ITest. Solved
  • C#: Displaying the class hierarchy for generic classes would fail to link a generic class to a derived constructed class. For example
    class IntList: List<int> {}
    would not show IntList as List<T> descendant. Similar problems would occur when navigating to generic ancestors - "Error: class List<int> not found.". Solved.
  • C#: constructor initializers would not accept the terniar operator "? :" Solved
  • Untyped var parameters could cause rare problems in method overload resolution. Solved.
  • MMX Documentation wizards: Pascal message handler type methods would expand macro <!typename!> into the message constant (for example WM_PAINT) where it should be empty. Solved.
  • MMXVS: Using the Members view Template palette to open a file would cause a hang up: the palette disappeared behind the VS code editor and could not be closed, the VS IDE could not be activated. Solved
  • MMXVS: Modal dialogs would appear with a button in the taskbar. Solved.