wiki:SecondLevelEclipse

A second-level Eclipse is when you run Eclipse as an application inside Eclipse. You will need to do this in order to do development on the Magnolia compiler itself, and if you want to run the SVN version of Magnolia rather than the published (and often out-of-date plugins from the update site).

Basic Setup

Checking out the source

Please refer to InstallationInstructions#a6.DevelopmentInstall.

Creating a Run/Debug Configuration

Select Run —> Debug Configurations from the menu (or from the little bug button on the toolbar). Double click on Eclipse Application to create a new debug configuration, and give it the name Magnolia (for example). When you run or debug this application, you will start a new instance of Eclipse; the workspace location is typically derived from your current workspace location and the configuration name.

You should set the current directory of the application to the plugin source directory: In the Arguments tab, in the Working directory area, click on Workspace and select the Magnolia project (magnolia-eclipse).

Your Debug Configuration will also work as a Run Configuration (e.g., for launching with the Play button rather than the Bug button).

Creating a new Debug Configuration

Launching for the first time

Press the Debug button to start Magnolia (you may need to have the Magnolia project or part of it selected in the Package navigator). On the welcome screen, go to the workbench.

You will now need to do the same SVN client selection fix as in the installation instructions.

If you need some Magnolia code to look at, you can check out trunk/magnolia-compiler-test from

https://svn.ii.uib.no/r/magnolia

Open one of the .mg files from the project. On first launch (and whenever the language has changed), a new parser will be generated, which may take several minutes. Once the parser is initialised, you should have syntax highlighting.

Problems

Out of sync

Sometimes the Magnolia plugin will fail for no apparent reason; typically after some rather serious compiler errors, after updates or after a new installations. This may be caused by the plugin code being out of sync. You will notice this in the Run —> Debug configurations —> Plug-ins view:

Out of sync plugin

This can usually be fixed by a combination of:

  • Fixing any outstanding errors. The problem might be related to missing exports from one of Magnolia's dependencies.
  • Refreshing (F5) all relevant projects.
  • Closing and opening the out of sync project (right click —> Close/Open Project).

Plugin doesn't start properly

You might see messages in the log about bundles not found. The solution is to open the Run/Debug configurations, going to the Plug-ins view, and hitting the "Add required plugins". You can check that all necessary plugins are selected by pressing "Validate Plugins".

No syntax highlighting, popup complaining about missing files

You have probably forgotten to set the current working directory of the second-level. Go back to "Creating a Run/Debug Configuration".

No syntax highlighting, possibly a popup complaining about missing classes

Most likely your parser is out-of-date. This should fix itself automatically after a while if you make a small change to any open Magnolia editor (you should see "Generating Magnolia parser" in the progress area once you start typing).

Last modified 12 years ago Last modified on Feb 8, 2012 4:51:35 PM

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.