Bug 422923 - File type association accepts only file extensions and no wildcards
Summary: File type association accepts only file extensions and no wildcards
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-02 04:29 EST by Christian Waldmann CLA
Modified: 2020-09-04 15:27 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Waldmann CLA 2013-12-02 04:29:49 EST
The syntax for defining file associations is miss leading. The "*" in a definition like "*.txt" in NOT a wildcard as expected, but only a placeholder.

When trying to use "*_c.txt", this definition is ignored at all.

When generating code to be included in source or header files, it would be handy to have regular expressions for file name definition.
Comment 1 Holger Voormann CLA 2018-05-04 01:30:51 EDT
To match the file "config.h.in", the pattern "*.in" works, but "*.h.in" does not.

See following Stack Overflow question: https://stackoverflow.com/q/50161965/6505250
Comment 2 Eyal Rozenberg CLA 2018-05-04 05:37:37 EDT
(In reply to Christian Waldmann from comment #0)

> When generating code to be included in source or header files, it would be
> handy to have regular expressions for file name definition.

That would be nice, but I would really like to see a quick fix for this in the form of at least having the wildcard work the way it's supposed to - and at least for a single wildcard. So even without any UI changes this should not be a hard fix.

(PS - I'm the person who asked the SO question.)
Comment 3 Nathan Ridge CLA 2018-05-05 18:12:30 EDT
I can't find it right now, but I recall having a discussion about this somewhere, and concluding that the relevant code that would need changes is inside the Eclipse Platform itself, not CDT.
Comment 4 Nathan Ridge CLA 2018-05-05 18:31:55 EDT
In particular, for the .h.in case, note that ContentTypeManager.getFileExtension() is implemented using lastIndexOf('.') [1]. I believe that would need to change.

[1] http://git.eclipse.org/c/gerrit/platform/eclipse.platform.runtime.git/tree/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeManager.java#n107