Community
Participate
Working Groups
Created attachment 202693 [details] First revision of the patch Currently indexer always relies on default content type to language binding. This becomes an issue, for instance, if custom parsing is needed for files that have default C/C++ extensions (e.g. .h) Please note that the patch attached ignores build profile as set on the indexer project properties page (I will implement this in a later revision of the patch). I would like to suggest having content type<->language bindings always go through the preferences as it will make the behavior of the indexer/build system/etc more consistent and will allow customizing the bindings on the product level. Another thing I prototyped and can create a patch is making CContentTypes::getContentType take content type hierarchy into the account. For instance if I have a content type com.mycompany.mylangheader bound to ".h" file extension and set CDT header content type as its base then CContentTypes would prefer it to CDT built-in header type. Currently it always picks CDT one and ends up using GPPLanguage to parse it. Allowing custom content types would allow binding languages to some headers that have .h extension but have specific names or some specific content (using the content describers).
Thanks, I have applied your patch.
*** cdt git genie on behalf of Eugene Ostroukhov *** Bug 356632: Project specific language mappings [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=b91945ccac8f23656084a3d303bb7c59a5e339c4
*** cdt git genie on behalf of Markus Schorn *** Bug 356632: Follow up porting fix to 8.0.2. [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=6337c3d624a192fca79949497a2ab69f3a7088fc
*** cdt git genie on behalf of Eugene Ostroukhov *** Bug 356632: Project specific language mappings [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=36e3d3ad1109729bb5cf9631bfc36ce3fbd511f1