<p></p>
<p>Yes, <code>.h</code> files are a known problem.  C and C++ are not the same language, so getting it wrong means symbols and possibly highlighting will be wrong.  Treating C header files as C++ is more likely to work (but not guaranteed) and as Geany treats C and C++ symbols as interchangable they will show in both C and C++ autocomplete.</p>
<p>Emacs has the same problem and uses the <code>-*-type-*-</code> in a first line comment to identify them.  On the system here almost all system include files have it, sometimes subtly, the following example line one is from my <code>libffi.h</code> :-)  It is also necessary for system C++ includes that have no extension.</p>
<pre><code>/* -----------------------------------------------------------------*-C-*-
</code></pre>
<p>The standard Geany filetype regex recognises and uses these marks, see the default <code>extract_filetype_regex</code> in various prefs.  This would be the recommended solution for your own headers if for some reason you can't use <code>.hpp</code> or <code>.hxx</code> for C++ headers.</p>
<p>Defaulting to C is the right(ish) thing to do for <code>.h</code> unless its marked.</p>
<p>Looking for a file with a C or C++ filetype with the same name will only work if the C or C++ file is already open when the header is opened since many/most projects put .h files in an <code>include</code> directory separate from the body files.  So Geany won't know where to look for body files.</p>
<p>The suggestion of adding the feature to one/all the project plugins would be a better idea since they usually know where files related to the project live, thats their purpose after all.  So they know where to search, or may even already have a list of project files they can lookup.</p>
<blockquote>
<p>I am concerned about the longevity of the GeanyLua plugin because Lua 5.1 is over 9 years past EOL.</p>
</blockquote>
<p>Unfortunately unless somebody ports GeanyLua to a newer Lua then I would have to agree with you that any script will likely have a limited lifetime.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/2946#issuecomment-945108055">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6SZHIDRLN6L5LWKG3UHK6IRANCNFSM5GEXDZLQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ2MWBOBYLCKLZIOVZDUHK6IRA5CNFSM5GEXDZL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHBKTIVY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2946#issuecomment-945108055",
"url": "https://github.com/geany/geany/issues/2946#issuecomment-945108055",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>