views:

136

answers:

1

I'd like to use embedded IronPython as a way of allowing users to script / extend my app. Running the scripts is easy enough, but I also need to provide some sort of IDE or editor as well - this is the bit I'm not sure how to do.

As far as I can see I have only a few options:

  1. Write myself a complete script editor, complete with syntax highlighting and a way of testing the code, however rely on attaching 3rd party debugging tools to provide debugging support.
  2. As above, however also write myself a debugger
  3. Somehow use an external IDE for editing my scripts.

The trouble with options 1. and 2. is that obviously they are a lot of work! (And will most likely be far inferior to "real" IDEs) - I was kind of hoping that someone else might have written an IronPython IDE that I could extend and embed in my app, but I've had no such luck.

Option 3. would be my preference - I'd imagine that I would save my script to a temporary file and then start the IDE with the path to my file as a parameter. The problem is that in order to be able to test / run the scripts, I need to set up some environmental objects beforehand - this makes testing and debugging the scripts from an external IDE rather cumbersome.

I don't mind insisting that only certain IDEs are supported (i.e. Visual Studio) and so I was kind of thinking I could write out a custom MSBuild file that ensured that the environment was all set up correctly when someone pressed F5, but then I realised I was starting to be silly. The other option I considered was if there were any open source IDEs that I could canibalise into embedded script editor.

Or alternatively is there another soltion that I'm missing?

A: 

The MonoDevelop IDE is open source, and it already has support for Python (but not IronPython AFAIK), so I imagine that might get you pretty close to what you want, with some modifications. Licensing is pretty liberal (LGPLv2 and MIT).

Robert Harvey