Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.
Version 25 (modified by asterite, 17 years ago)
--

Welcome to Descent

The aim of this project is to provide an Eclipse plugin for writing code in the D programming language from Digital Mars. It's still in alpha stage.

How the plugin is being made?

Various steps are being made in order to make the plugin functional:

  1. Port the DMD source code to Java. Instead of using some language processing tool like ANTLR, this has the following advantages:
    • Not having to understand the syntax in the digital mars webpage, which is constantly changing at a very speed rate.
    • Updates to the language are easily adopted by the plugin: just diff it :-)
    • No need to think of a model: Walter already took care of that (although the model is a bit changed in Descent)
  2. Bring all the functionality of JDT into this plugin... by copying the source code of JDT and making the necessary changes to reflect D code, not Java code. This in turn can be done in the following steps:
    1. Make an AST model like in JDT: http://help.eclipse.org/help32/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/package-summary.html
    2. Copy a lot of classes from JDT to bring "Java like" functionality to the plugin. D is a superset of Java (except for annotations) so "Java" code written in D, changing the appropiate keywords and on, should work in the plugin. By this I mean: if only imports, classes, fields and methods are written in D, D is almost like Java.
    3. Update and add the necessary classes to support D, not Java.

This approach has one major drawback: until at least the "Java like" functionality is done, the plugin is useless: it's just a bunch of classes waiting to be assembled and finished to work properly together. Releases until this point have no sense. That's why there aren't updates regularily.

But I believe this approach is better than reinventing the wheel in the field of implementing an IDE for a specific language in Eclipse. The JDT team has made a great job, and their plugin has a lot of features which would be awsome to have in D editor, and it's much better to stand on the shoulders of giants instead of thinking the way of implementing those features from the beginning.

What is done?

  • Ported most of DMD lexer and parser code, and statement covered by tests by %85 percent.
  • Added source range information to the classes in the model.
  • The AST nodes are very similar to the ones found in the JDT plugin for Eclipse. They still don't have bindings, though.
  • And ASTView plugin to see the AST tree built by the plugin.
  • Simple syntax errors are marked in the code (not just the line number, but the exact position)
  • Syntax highlighting (colors still not configurable).
  • Outline View (still not fully functional, and broken at the moment)
  • The rewrite engine (http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/package-summary.html ASTRewrite and others]) is being made.

How to get it?

The downloadable version features a nice and useful editor, an outline view, automatic documentation generation over types and functions, some code templates, and lots of JDT features that are still not here, so don't wonder why they do not work. :-)

*Important:* if the new version dosen't appear in the "Find and install" window, try running eclipse from the command line with the "-clean" argument.

  1. Run Eclipse.
  2. Goto "Help -> Software updates -> Find and install..." and click Next.
  3. Select "Search for new features to install" and click Next.
  4. Click "New remote site...".
  5. Enter "Descent" in the name field.
  6. Enter "http://svn.dsource.org/projects/descent/trunk/descent.update-site/" in the URL field.
  7. Click Ok.
  8. Click Finish.
  9. From here, check all the checkboxes found, and click Next.
  10. Accept the license agreement and click Next, and then finish.

After the plugin installs, restart Eclipse.

Go to "File -> New -> Project". In the "D" category select "D Project", enter it's location and hit OK.

Documentation

Some documentation is here: http://www.prowiki.org/wiki4d/wiki.cgi?DescentUI

But most is in the following sections.

What to do next?

Now we are focusing in:

  • Making the build and launch system.
  • Updating the Parser and AST nodes for error recovery (while parsing).
  • Copying the rewrite engine.
  • Building the Java model from D source.
  • Moving from Java code to D code.