<html><head></head><body>I actually prefer C, and since I've been playing with C++ I like it a lot so far. The app I'm working on is actually a C app with a C++ wrapper connecting it to a QML gui.<br>
<br>
And I already added QML by copying the javascript configuration file and adding certain keywords, such as the QML basic types for highlighting.<br>
<br>
I didn't realize I'd have to create the lexer myself. Is it possible to use the C lexer that's already in Geany and then work it into the QML file type? The only thing I really want to get working is the symbol list (which would be the ctags thing you refered to if I'm not mistaken, right?).<br>
<br>
I'm already writing my QML in Geany, but it would be awesome to be able to see the symbols.<br><br><div class="gmail_quote">Matthew Brush <mbrush@codebrainz.ca> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 13-09-17 08:02 AM, Tory Gaurnier wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">I'm interested in making a patch to add QML support to Geany, but first<br />I had a few questions. First of all, is anyone else already working on<br />this? And if not, if I manage to get it working well would my patch be<br />worked into the main Geany code so others could get it also? I've been<br />learning programming for a while, but I've never patched or edited<br />anyone else’s code, so I'm not making promises how fast I'd be able to<br />get this done, of course from looking at the hacking page it doesn't<br />look to complicated to add support for another language, I just wanted<br />to ask these questions before I even attempted this.</blockquote><br /><br />To answer your questions first; no, no one is working on it AFAIK, and <br />if you follow the guidelines and write decent code,
yes, I'm sure we <br />would include it Geany. I'd rather like to use QML in Geany myself as I <br />find QtCreator to be way too big and slow for something so simple (even <br />if it's quite nice overall).<br /><br />You found probably the most important info already (notes in HACKING <br />file), so that's a good start :)<br /><br />We use Scintilla[1] for the editing component as you probably know, and <br />it seems like no one is working on this, though someone talked on the <br />their mailing list[2] about starting to work on one last year. In order <br />to get syntax highlighting support for QML, you'll need to code up a <br />lexer in C++ (actually very C-like C++) and get it included into <br />Scintilla project. With that, we can pull it downstream and integrate <br />into Geany.<br /><br />We use a fork of CTags[3] inside Geany for tag/symbol parsing, so in <br />order to have that supported for QML you'll need to code up a parser in <br />C and ideally get it included
into CTags, but more likely we could just <br />pull it into Geany directly first.<br /><br />With those two things done, which aren't exactly trivial, but for a <br />language like QML, probably aren't super difficult, then you can do the <br />stuff in the HACKING file to integrate everything into Geany, which is <br />the easiest part.<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Honestly it'll probably take me longer to figure out how to create and<br />submit the patch then it will to actually change the code in the source<br />itself.</blockquote><br /><br />Naw, writing the Scintilla lexer and Ctags parser will probably be the <br />hardest part as writing lexers and parsers isn't the easiest thing in <br />the world (especially in C and C++). The rest is just learning how to <br />use the version control system and common knowledge you can find online <br />about best practices for making
commits and using the tools (in our case <br />Git, and Mercurial for Scintilla - which is quite similar). If you work <br />in features branches, and make small incremental commits, you can go <br />back after and re-jigger everything into nice clean patches for Geany <br />and Scintilla.<br /><br />All that being said, if you aren't a strong C programmer and have no <br />interest in becoming one, all of this is probably way too much trouble <br />for what it's worth :) Unfortunately adding new proper language support <br />to Geany is quite difficult compared to most editors. Alternatively, you <br />might be able to get reasonable results by re-using existing filetypes <br />in Geany, maybe basing it on JavaScript or something more similar to <br />QML. Check Geany's manual for "custom filetypes"[4] for more info on <br />this much easier approach, there's a few existing examples of these kind <br />in Geany's source tree[5].<br /><br />Cheers,<br />Matthew Brush<br /><br />[1]
<a href="http://www.scintilla.org">http://www.scintilla.org</a>/<br />[2] <br /><a href="https://groups.google.com/d/msg/scintilla-interest/jxch35Fue2k/ExZcjlrHdRkJ">https://groups.google.com/d/msg/scintilla-interest/jxch35Fue2k/ExZcjlrHdRkJ</a><br />[3] <a href="http://ctags.sourceforge.net">http://ctags.sourceforge.net</a>/<br />[4] <a href="http://www.geany.org/manual/current/index.html#custom-filetypes">http://www.geany.org/manual/current/index.html#custom-filetypes</a><br />[5] <a href="https://github.com/geany/geany/blob/master/data/filetypes.Cython.conf">https://github.com/geany/geany/blob/master/data/filetypes.Cython.conf</a><br /><hr /><br />Devel mailing list<br />Devel@lists.geany.org<br /><a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</body></html>