-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
What feature would you like to see?
Currently, #pragma magic [ ... ] can be used to enable automatic loading of patterns by fIle contents. I would like to see the addition of #pragma extensions [ .ext .ext2 ... ] or something similar.
In an ideal case, both would be usable simultaneously, and #pragma extensions would serve as a fallback only after exhausting all options. That is, try to match patterns with #pragma magic first, and if no pattern claims the format, search again using #pragma extensions instead.
How will this feature be useful to you and others?
Ordinarily, I would be against this idea on the count of the fact that a file extension does not reliably identify the contents of a file. However, there are some scenarios where a file doesn't have a header at all, and so there is currently no way to propose a pattern file for its contents. This would fill that gap.
Request Type
- I can provide a PoC for this feature or am willing to work on it myself and submit a PR
Additional context?
No response