Re: [code] C++ Support

From: Mitchell <>
Date: Mon, 2 Jun 2014 15:30:13 -0400 (Eastern Daylight Time)

Hi Ryan,

On Mon, 2 Jun 2014, Ryan Pusztai wrote:

> Hi Mitchell,
> I am really struggling because there used to be a CPP module to go along
> with the CPP lexer and now it is gone. I have talked about this in the past
> and tried to use the ansi_c module as an example because it does the
> "things" I was looking for. Now it has significantly changed again (my cpp
> module on ly lasted 1 major release) and I am not experienced enough with
> TextAdept and it's internals to rewrite this module. My plea is for you to
> bring back the CPP module or make the ansi_c module load for both ansci_c
> and cpp lexers. I want basic autocomplete and the ability to add api files
> for libraries I use. I also wanted the ability to use a 'post_init.lua' to
> add some other utility functions to my open cpp buffers.

Sorry to hear the latest changes are causing you so much trouble :( When I
removed Adeptsense, I failed to take into consideration your use case;
please accept my apologies.

The quick fix is to simply copy *modules/ansi_c/init.lua* to
*~/.textadept/modules/cpp/init.lua* and replace all instances of "ansi_c"
with "cpp". (You can keep your existing *post_init.lua*, which should
remain unaffected.) By making the copy, you retain the ability to add api
files (via *post_init.lua*) as well as make use of ansi_c's simple
autocomplete capabilities via ctags. I hope this makes sense. If it's
still not working, send me your old module off-list and I'll help make the
necessary modifications for you.

> I know this sounds like bitching and it really is, but I love this editor
> and the direction you are going is the direction I want to go. I am just
> struggling with how the changes impact my .textadept directory and how much
> work it is to keep them up to date with such a fluid API. It makes me think
> twice about not updating to the latest TextAdept.

I understand what you mean, and I'm sorry it happened. Believe me that for
every change I make, I do my best to think about how it affects existing
users. For this release I was quite confident that removing Adeptsense
wouldn't cause any problems, but as I mentioned, I failed to think of your

Most API changes are additions. I try to minimize removals, and do my best
to restrict them only to things I judge to be unused by all. Any
modifications (such as `autocomplete_word()` that you brought up in your
earlier e-mail) are taken seriously and only made when I deem it necessary
for the "greater good". In this case, the new autocompleter functionality
superceded `autocomplete_word()`.

> I you know I mean this in the best intention. I just feel like others
> might be feeling the same way. Thoughts? Or should I just shut up and be
> happy, which I will gladly do.

Thanks for your feedback, and I encourage you to speak your mind in the
future. This release was difficult for me because I really needed to
remove some cruft and clean things up before things got out of hand, but
at the same time I was afraid of causing problems.

I will take this as a learning experience for me. I hope you will believe
me when I say that this will not happen in a minor release again (7.x). I
don't ever want you to worry about upgrading in that case.

> P.S. I would like to create api files for some big libraries (e.g. Boost,
> wxWidgets) I use, but I could not figure out how to generate the api files
> using ctags. Can you give me any pointers. I saw you generate some, but it
> looks like you used Lua to write the parser and C++ is a bit too
> complicated to get correct when ctags is arround. I hope this makes sense.

ctags cannot generate api files. I believe I produced the ANSI C module's
C and Lua api files by hand. The Lua module's api file is generated by the
LuaDoc tool, which specializes in parsing documentation out of Lua source
files. In your case you'd need a tool to parse out Boost/wxWidgets
documentation into the API file format.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Mon 02 Jun 2014 - 15:30:13 EDT

This archive was generated by hypermail 2.2.0 : Tue 03 Jun 2014 - 06:52:10 EDT