[Geany] CTAGS and C++

Enrico Tröger enrico.troeger at xxxxx
Fri Mar 27 17:07:55 UTC 2009


On Fri, 27 Mar 2009 09:47:58 -0700, Bob wrote:

>Enrico Tröger wrote:
>> On Thu, 26 Mar 2009 16:00:49 -0700, Bob wrote:
>>
>>   
>>> I'm using Geany for work on a rather large C++ codebase where all of
>>> the header files have .h suffixes. Most of the declarations in these
>>> header files are inside namespaces and class declarations and
>>> apparently the tag parser only sees these as C headers and not C++
>>> headers, so none of these declarations show up in the Symbols pane.
>>>
>>> If I rename the files to .hh or .hpp then all the declarations show
>>> up. If I remove the enclosing namespace or class, then the
>>> declarations appear even when the suffix is .c
>>>
>>> Is there any way to tell Geany to treat these .h files as C++ code?
>>>     
>>
>> Yes, create/edit the file ~/.config/geany/filetype_extensions.conf
>> and add/edit the following content:
>>
>> [Extensions]
>> C=*.c;
>> C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;*.h;
>>
>> this will overwrite the default filetype extensions for C and C++ and
>> moves *.h from the filetype C to C++.
>> Downside of this is that *all* header files will now be opened as C+
>> +. 
>
>Thanks Enrico. This has solved my problem. I had tried editing this
>file but not by removing the .h from the C list. I don't see the
>'downside' as much of a problem - a C header parsed for tags as C++
>should look pretty much the same.

Yes, the parsing itself shouldn't be much affected. But it comes to
problems with autocompletion, so parsed symbols in a header file which
is C but was opened as C++, you don't see the symbols of this header
file in C files.
Not the worst thing on earth, just wanted to mention it.


>> P.S.: either my mail client is broken or your mail is sent in a
>> strange way. It has the text in the text/html part but an empty
>> text/plain part which caused me some troubles in getting the quoted
>> text into my answer :(. But it could also be my mail client.
>> At least I thought if a mail is sent with some HTML code, the
>> text/plain part should contain a *plain text* version for those of us
>> who don't like HTML in emails...
>>   
>
>Mea culpa. My mail client is Thunderbird and have it set to 'ask
>before sending' but I've got the bad habit of hitting the 'HTML only'
>button when it asks. I've now added uvena.de to the 'text only' list
>so I shouldn't happen again.

Thanks, that makes me actually happy.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20090327/3747f885/attachment.pgp>


More information about the Users mailing list