[Qt-creator] Adding support for a new programming language to Qt Creator

André Pönitz andre.poenitz at mathematik.tu-chemnitz.de
Fri Sep 20 21:38:53 CEST 2013


On Fri, Sep 20, 2013 at 04:40:02PM +0200, Joseph Rushton Wakeling wrote:
> Hello all,
> 
> I'm new user of Qt Creator, so please forgive me if the question here is naive 
> -- I have tried searching around for an answer without really finding anything 
> definitive.
> 
> How can one go about adding support for new languages to Qt Creator?  From what 
> I have seen there is a fairly substantial collection of syntax highlighting 
> rulesets (all derived from Kate?), but these don't necessarily correspond to 
> support for things like auto-indentation and obviously don't offer support for 
> build or debugging tools.


> The language I'm particularly interested in adding support for is D 
> <http://dlang.org>.  There is already syntax support in place with a d.xml 
> that's taken from Kate (and dates from about 2 years ago).  I'd like to be able 
> to extend that with auto-indentation (and if possible autocompletion) support, 
> and to be able to add support for compiling and [...]

Syntax highlighting in Creator comes in three levels. Roughly speaking the
"better" ones based on a "real" parser (used for C++, JS, GLSL, ...) and as
a fallback there's a generic highlighting that understands Kate's syntax
files, and finally the "no highlighting" state.

For D you currently get the Kate fallback. To improve the situation you'd
need to implement a real parser.

> debugging D (it should be possible to do this with GDB and LLDB).

Last time I looked the debugging info produced by some D compilers was
pretty broken. E.g. DMD version 2.058 "encoded" the string[] type as
"_Array_uns long long". It's hard to base proper debugging on such
a foundation.

> I know from the D language forums that about 3 years ago there was some interest 
> in adding D support to Qt Creator, but so far as I can see this didn't go beyond 
> the syntax highlighting file.

There are occasional short visits of people interested in D support on
IRC, but so far no indeed no permanent interest. 
 
> Qt Creator makes a great candidate for a light, fast and effective 
> cross-platform IDE which doesn't carry a huge baggage of dependencies, so I'd 
> really like to have good D support in it.  Any advice on how to go about doing 
> this would be really appreciated.

As Orgad already pointed out, there's the Python plugin to have a look at.
That shows most of the structure of a "language support plugin" but that
does not have a real code model yet. Alternately, check the GLSL related bits,
that's rather small and reasonably complete.

For quick questions, #qt-creator at FreeNode IRC is a good choice during
central European working hours.

Andre'



More information about the Qt-creator mailing list