[MonoDevelop] Adding a SyntaxMode XML file

Doug Blank doug.blank at gmail.com
Mon Jan 24 10:53:09 EST 2011


On Mon, Jan 24, 2011 at 9:41 AM, Michael Hutchinson
<m.j.hutchinson at gmail.com> wrote:
>
> On Jan 24, 2011 1:17 AM, "Doug Blank" <doug.blank at gmail.com> wrote:
>>
>> On Mon, Jan 24, 2011 at 12:52 AM, Michael Hutchinson
>> <m.j.hutchinson at gmail.com> wrote:
>> >
>> > On Jan 23, 2011 10:30 PM, "Doug Blank" <doug.blank at gmail.com> wrote:
>> >>
>> >> Is there a way to add a SyntaxMode XML file for a language after I
>> >> already have the Mono.TextEditor.dll built? I've tried putting an
>> >> additional SchemeSyntaxMode.xml file in the same directory, and in a
>> >> SyntaxModes directory, but it didn't use it. Or, is there a way to add
>> >> the xml file to the DLL?
>> >
>> > You can register it using an addin:
>> >
>> > <Extension path = "/MonoDevelop/SourceEditor2/SyntaxModes">
>> > <Templates resource="SomeSyntaxMode.xml" />
>> > </Extension>
>>
>> I forgot to say that I'm not using MonoDevelop. Can I register the
>> .xml file just through Mono.TextEditor.dll? That is the only DLL that
>> I am currently using. (Just using the TextEditor in my own
>> application).
>
> Sure. Just take a look at how MonoDevelop.SourceEditor2 implements that
> extension point.

Thanks! Looks like it is working great. For future generations, in IronPython:

>>> import clr, os
>>> clr.AddReference("Mono.TextEditor")
>>> from Mono.TextEditor import Highlighting
>>> Highlighting.SyntaxModeService.LoadStylesAndModes(os.path.abspath("../bin/SyntaxModes/"))

-Doug


More information about the Monodevelop-list mailing list