[MonoDevelop] Using the managed source editor outside of MonoDevelop
m.j.hutchinson at gmail.com
Tue Sep 30 01:50:17 EDT 2008
On Mon, Sep 29, 2008 at 11:31 PM, Andy Selvig <ajselvig at gmail.com> wrote:
> Thanks for all the quick replies.
> It's good to hear about the licensing. MonoDevelop has some great components
> that would be a shame to wrap up in the GPL. Out of curiosity, why such a
> drastic licensing change for MonoDevelop? The GPL and MIT/X11 are at the
> opposite ends of the Open Source spectrum.
MonoDevelop is derived from SharpDevelop, which was at the time GPL,
but as you may have noticed, Mono tends towards more liberal licences.
In fact, #D did relicense to LGPL in order to allow commercial/closed
addins, but they have so far refused to relicense our fork :-/
> I downloaded the latest source from svn and built Mono.Texteditor. I wrote a
> simple app that display an editor, which seems to work fine. I guess it
> would be nice to have a little guidance on how to do things like syntax
> highlighting for langauges like C# and boo, enable code folding and
> auto-indentation, and possibly have some sort of API for auto-completion.
> I'm assuming that everything but the latter is part of Mono.Texteditor, but
> I don't know how to use it.
It will syntax highlight text when you tell it the mimetype of the
document. There are built-in highlighting schemes for C# and Boo
(among others), and APIs to add your own schemes.
Beyond that, things get more complicated. There's a simple property
somewhere for telling it to "auto-indent" (i.e. maintain the current
indentation level), but "smart" indentation requires a
language-specific indenter. We have ones for C# and C, but they're
elsewhere in MD. For folding, you need to feed the TextEditor a list
of fold regions so it knows where to fold -- likewise, we get this
from parsers elsewhere in MD. I can provide more info on where/how if
you need it, but if you're implementing this much, you might as well
just use all of MD :-)
The MonoDevelop.SourceEditor2 assembly is the only MD assembly that
depends on the TextEditor. It basically plugs it into MD's abstract
text editor interfaces, and completion & smart indenters etc sit on
top of these interfaces.
Can you tell me what you're writing? It would help in understanding
the functionality you need.
More information about the Monodevelop-list