Page 1 of 1

[done] Adding supported file type to Launch plugin

PostPosted: Sat Nov 07, 2009 4:08 pm
by appliedmath
Hello,

I would like to use the Launch plugin for quick C compiling and running. Ideally, the Launch plugin could have user customizable File Type association and user definable commandline (another popular editor Geany has support for C as such.) I was wondering if such a feature could be added.

Re: Adding supported file type to Launch plugin

PostPosted: Sat Nov 07, 2009 5:23 pm
by cody
Hi,

You can already define your own commands in the Launch config dialog. File type associations can be configured in the main Editra preferences dialog under Document=>Syntax Highlighting.

Perhaps you mean something more/else? If so could you explain the workflow that your looking for in a little more detail?

Cody

Re: Adding supported file type to Launch plugin

PostPosted: Sat Nov 07, 2009 5:53 pm
by appliedmath
Thanks for your reply.

Yes, file type association for the entire editor is configurable like you said for syntax highlighting purposes, but not for Launch plugin (to my knowledge). I don't see C file as an option for the Launch plugin, and I don't know how to add it. Once I add the C file type, then, like you said, I can define a custom commandline through the Launch plugin.

So the question boils down to, I want to add a file type association to the Launch plugin.

Thanks.

Re: Adding supported file type to Launch plugin

PostPosted: Sat Nov 07, 2009 6:09 pm
by cody
Hi,

Ok, now I see.

Just wait for the next version, I will be adding an xml interface similar to what was added in 0.5.15 for the syntax highlighting, you will then be able to add support for new filetypes by adding a couple lines to an xml file in your config directory. (UI interface for it will also likely be added in future releases.)

Some rough draft docs on the xml interface http://editra.org/syntax_highlighting_customization

The file type associations that are configurable in the syntax highlighting tab of the preference dialog actually apply to everything, launch determines what type a file is by pulling from this configuration, codebrowser does the same.

Will update when the modifications to Launch are complete.


Cody

Re: Adding supported file type to Launch plugin

PostPosted: Sat Nov 07, 2009 6:19 pm
by appliedmath
Thank you very much. Editra is such a great software. Thanks for your hard work.

Re: Adding supported file type to Launch plugin

PostPosted: Tue Nov 10, 2009 3:02 am
by cody
Done for version 1.5 of the plugin.

I am quite pleased how this turned out so far, it will be possible to add any arbitrary number of new filetype handlers by editing a file in your user config directory.

For example this will be the bare minimum to add support for C

Code: Select all
<launch version="1">
    <handler name="C" id="ID_LANG_C"></handler>
</launch>


It also offers options to add default handlers and optional highlighting of error output in the buffer. So an extended version would look like this.

Code: Select all
<launch version="1">
    <handler name="C" id="ID_LANG_C">
       <commandlist default="make">
          <command name="make" execute="make"/>
          <command name="g++" execute="g++ -c"/>
       </commandlist>
       <!-- If your compiler output errors like
             "line: 22 file: myfile.c"
       -->
       <error pattern="error\: ln ([0-9]+) file\: (.*)"/>
    </handler>
</launch>


Docs and detailed specs will be available on the documentation page by the next release.


Cody

Re: Adding supported file type to Launch plugin

PostPosted: Tue Nov 10, 2009 3:47 am
by appliedmath
Perfect. Thanks a lot.