[MonoDevelop] Using the managed source editor outside of MonoDevelop

Andy Selvig ajselvig at gmail.com
Tue Sep 30 08:18:55 EDT 2008


> 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.

Okay, I guessed I missed that when browsing the code. Is mimetype a
property of Document? (I don't have the code in front of me)

> 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.

Yeah, "smart" indentation is what I was thinking of.

> 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 :-)

That's one heck of an upstream dependency just to get a text editor :-)

> 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.

I'd like to have an integrated text editor that will allow for
scripting extensibility in my application (mainly Boo, but ideally
Python or Ruby also). In Windows, I can use the ScintillaNET
(http://www.codeplex.com/ScintillaNET) bindings that give me an easy
to use editor with the following features:
 - syntax highlighting
 - code folding
 - code completion API

I was hoping to be able to use the MD component as it seems (correct
me if I'm wrong) that GtkSourceView lacks the last two. And, as far as
I know, there is no way to use Scintilla with Gtk# without writing my
own bindings.

- Andy


More information about the Monodevelop-list mailing list