Mmrnmhrm
Mmrnmhrm (pronounced mer-nem-herm) is a Eclipse D IDE, partially based on Descent, aimed at bringing semantic IDE functionality (such as code completion, find definition, find references, etc.) to D. It was developed by Bruno Medeiros, but is now under hiatus status.
Latest version: 0.2.2 (changelog)
Download Area: http://svn.dsource.org/projects/descent/downloads/mmrnmhrm-0.2.2/
IDE features
- Rich JDT-like project model
- Supporting DMD+Phobos compiler install location and Standard Lib
- D Editor:
- Syntax Highlighting (with preference page)
- Content Outline and rich Quick-Outline
- Folding, bracket matching
- Find Definition (with hyperlinking and unformatted DDoc text hovers (pic))
- Code Completion (pic1, pic2-defunits)
- Open-Type dialog
- Semantic Search
- Search for definitions based on a text pattern
- Search for all references to a given definition
- Integrated builder support
- Very basic launch support (no debugger integration)
This video of DTLK Ruby demonstrates features which are also available in Mmrnmhrm (except for Call Hierarchy, Dee Documentation View or Code Templates).
Installation
Requirements: Eclipse 3.3, JVM 1.5 or superior, and the DLTK (http://www.eclipse.org/dltk/) Core Framework 0.9. You can download the latest Mmrnmhrm version here. Install by removing all previous Mmrnmhrm jar files, and placing all the latest ones in the Eclipse plugin directory. But an alternative method (installing as an extension location) is recommended: Unzip the Mmrnmhrm zip to a desired install location, then open Eclipse, go to Help/Software Updates/Manage Configuration , select Eclipse SDK, click "Add an Extension Location", choose the unzipped folder, reboot. DTLK itself may be installed similarly. Download this build: dltk-core-R-0.9.1-200709271332-incubation.zip and install it as above (can be in the same extension location, or a different one).
Descent may or may not be installed as well, altough if it is, it's editor may take priority in opening .d files. (Note: if you edit the ".project" file it is possible to have a project with both the Mmrnmhrm and Descent nature)
Documentation
Basics:
Create a new D Mmrnmhrm project with the new D project wizard. There is no D perspective in Mmrnmhrm yet, but you can create a copy of the resource perspective (open the context menu on the perspective icon, select "Save As"). Use the Script Explorer view to see and manipulate the project model, as DTLK doesn't yet support the Project Explorer View. Also, you may wish to customize the perspective's actions, so that the Launch Action Set appears (open the context menu on the perspective icon, "Customize", "Commands", enable "Launch" on the "Available command groups").
If you have Descent installed, it's editor will take precedence os most situations when opening .d files. You can configure the default .d editor in Eclipse Preferences, General, Editors, File Associations. Add a .d file type there, and the list of associated editors will show up below. Select Mmrnmhrm as the default.
Build Path:
The build path is the set of folders and libraries that contain the D files that constitute the D project. The imports on semantic features (such as code completion) will only see the files contained in the build path. If you already know how JDT work, it's all very similar. The managed build also works according to the project build path. The build path can be configured in the "D Build Path (Mmrnmrhm)" project property page, or in several context menu actions of the Script Explorer view. The simplest element of the build path is a source folder, which is a folder that contains D files (.d or .di), whose module/package declaration must match the filesystem directory hierarchy, rooted at the source folder.
If you have configured a compiler, the it's standard library (Phobos support only) will also be available at build path.
Project references (as in references between projects) are not yet support as build path entrie, nor are zipped folder/libraries.
Find Definition:
The Find Ref functionality is invoked by pressing F3 when in the Mmrnhrm D editor, or by clicking the Find Ref button placed in the toolbar. When using the toolbar button, Find Ref will work for in any text editor (including Descent's), however it won't be able to follow imports across modules, if the file is not on the build path of a Mmrnmhrm project. Find-ref is also available in the form of editor hyperlinking (hold Ctrl and select a reference with the mouse).
This functionality Locates any definition unit: Module, class, struct/union, variable, function parameter, template, template parameter, alias, typedef, named enums, enum members, unnamed enum members, named mixins, import aliases, import selections. (FIXME)Unsupported:
- Searching inside unnamed mixins, and the scope of the with() statement.
- Special reference targets: goto labels, version/debug identifiers.
- Most expression reference nodes (including function calls).
- Special references (new, delete, this, super).
- Some native references (int, void, arrays, functions, etc.).
- Function or template overload resolution (if there are several matches, lists all homonyms).
Text Hover: Text hover shows a text popup with some info (signature + DDoc) over the reference or definition under the mouse cursor.
Code Completion: Has the same semantic power as find-ref to determine completions. May not work 100% correctly (if at all) when a file has syntax errors. It does try to recover for some common syntax errors however. Does not yet consider name shadowing.
Open-Type dialog: Invoke with Ctrl-Shift-T. Works the same as JDT, you can use all-caps to search for camel case names, ie, NPE -> NullPointerException. Note, this functionality has some DLTK bugs, some definitions may not be indexed.
Semantic Search: The search dialog allows searching for definitions based on a text pattern (Main menu: Search/D...). It is also possible to search for all references to a given definition. Select a definition unit, and use the editor's context menu to search for references (shortcut: Ctrl-Shift-G). This can also be invoked on references, in which all references to the same target definition will be search for.
Builder and launch: There is some support for integrated builder functionality, namely, the IDE can automatically manage some of the build settings according to the IDE's D project configuration. The build settings can be accessed on the "D Compile Options" project properties page. Here's how it works: Mmrnmhrm will create a build.rf file in the project root folder and then invoke a builder according to the "Build Command:" configuration entry. You can, and should, specify arguments to the build command here, such as the response file "build.rf". The contents of the build.rf file will be the same as the "Managed Response File" configuration entry, except that some special tokens will be replaced according to the IDE's project configuration. With this functionality it should be possible to use any builder, such as rebuild, bud, or even DMD itself. New D projects have a default builder configuration set up for usage with rebuild, which should work out of the box if you have rebuild on the path. The available replace tokens are:
- $DEEBUILDER.OUTPUTPATH - Project relative output path
- $DEEBUILDER.OUTPUTEXE - Project relative output executable path
- $DEEBUILDER.SRCLIBS.-I - Absolute path of all source libs, each prefixed by "-I" and separated by newlines
- $DEEBUILDER.SRCFOLDERS.-I - Project relative path of all source folder, each prefixed by "-I" and separated by newlines
- $DEEBUILDER.SRCMODULES - All source modules (.d files) found in the project's source folders, separated by newlines
Also, the IDE will run the build command with a modified path: The DMD compiler path will be added as the first entry in the proccess PATH environment variable [This is because rebuild doesn't have an option to specify the compiler and bud's -DCPATH is currently broken]. This path is obtained from the configured "interpreter" of the D project.
When run, the builder will print its output on the Eclipse console. If by any reason you have problems with the builder, it can be disabled on the Builders page of the project properties.
Launch support merely Runs the executable file associated with a D project, so it's almost like an External Tool launch mode. There is no Debug support but you can use Descent's debugger with a minor degree of integration (you can manage Descent's breakpoints in Mmrnmhrm's editor).
Future directions
- Continous integration with DTLK upcoming features (such as Type Hierarchy, or bug fixes).
- Improvements on the find-ref semantic engine.
- Improvements on the parser error recovery?
- Further integration with Descent?
