| Summary: | Teach CDT Indexer to index c files with other extensions {like .ck, .hk etc} which have c source | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Purush Gupta <purushgupta> |
| Component: | cdt-indexer | Assignee: | Project Inbox <cdt-indexer-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Markus Schorn <mschorn.eclipse> |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | cdtdoug, recoskie |
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Purush Gupta
It is possible to make LanguageManager.getLanguageForFile() retrieve language from MBS toolchain InputType and we can use this bug to consider that.
But perhaps in your case you should define a new content type in plugin.xml
<extension
point="org.eclipse.core.contenttype.contentTypes">
<file-association
content-type="org.eclipse.cdt.core.cHeader"
file-extensions="hk">
</file-association>
<file-association
content-type="org.eclipse.cdt.core.cSource"
file-extensions="ck">
</file-association>
<!-- or
<file-association
content-type="org.eclipse.cdt.core.cxxSource"
file-extensions="ck">
</file-association>
-->
</extension>
If you add those extensions to the proper C/C++ content types, I would think this would just work. (In reply to comment #2) > If you add those extensions to the proper C/C++ content types, I would think > this would just work. Thank you for your replies. Tried following 'how to' from http://wiki.eclipse.org/CDT/User/FAQ How can I add another extension to CDT so that files other than c/cpp/cc/h files are recognized as source files? My compiler needs the file extension to be "xyz", and when I open xyz files there is no syntax highlighting. >>> Seems to do the trick for me, but I noticed the tooltip does not work, I need to provide further info probably in new feature req Regarding suggestion 1, it seems like I may have to rebuild the CDT from source unless there is a way to to change the plugin.xml in the default disto Bugzilla is not really a proper place to ask questions, please use cdt-dev development list from https://dev.eclipse.org/mailman/listinfo if you are plugin developer, or if you are not a developer ask at user forums http://www.eclipse.org/forums/ (select CDT). But answering your question, you need to add that to the plugin which defines the toolchain which uses .ck and .hk. As a user (if you are not developing plugin) you can associate file extensions with the content types in Preferences->General->Content Types. I think the question has been answered. |