-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make built-in adapters' identifiers configurable #247
base: master
Are you sure you want to change the base?
Make built-in adapters' identifiers configurable #247
Conversation
b53f171
to
24f57ef
Compare
82fb415
to
80cbb9d
Compare
@phiresky This is ready for your review whenever you get the chance. |
@phiresky Bumping the request for review. |
In general this seems like probably a good idea, but I'm not sure about the approach?
Maybe it would be better and simpler to use a syntax like As in, you specify pairs of extensions [a,b] and every file with extension a is treated as if it had extension b. That way you also don't the additional mapping of how the adapter should treat the file internally (only relevant for the The only change that would be needed is that the "fake" extension needs to be given to the adapter. Since some files given to an adapter already don't actually exist on the FS (e.g. within zips), this can potentially be done by just changing /// file path. May not be an actual file on the file system (e.g. in an archive). Used for matching file extensions.
pub filepath_hint: PathBuf, Then no other changes are required per adapter, and the override also works to temporarily override extensions of custom adapters a user has configured. |
Going the complete other way: This problem seems to really only have appeared for But probably the general solution above is better |
9b45e19
to
982b233
Compare
Settings like Anyway sorry for my delay for review but it is always happy to see things are growing :) |
sqlite databases can also be named custom things. vscode names them things like "state.vscdb" -- I'm trying to extract my Cursor LLM conversations for example, but I don't know which workspace has what uuid. rga seemed like a great fit, but the extension issue cropped up. |
Great example of extension remapping also being useful for other purposes . @lafrenierejm would you be willing to update/rewrite your implementation to use rga --rga-additional-extensions jar=zip,xlsx=zip,vscdb=sqlite3 and in the config file:
or
instead of modifying individual adapters? @perplexes: note that --rga-accurate should work for your case though |
Certainly! I think I will have time to do so within the next week or so, but I can't promise that. |
982b233
to
93fc5ab
Compare
This will allow end users to provide their own lists of extensions and/or mimetypes for each of the built-in adapters.
93fc5ab
to
5308890
Compare
@phiresky The initial refactor for this is done. I went ahead and exposed mimetypes in addition to extensions. I named the options I haven't implemented thorough tests yet. That should be done before this PR is considered ready for merge. |
This will allow end users to provide their own lists of extensions and/or mimetypes for each of the built-in adapters.
This feature would obsolete the need for feature requests such as:
.als
file support #185The functionality proposed here is a superset of that in #244. That PR makes only the Zip adapter's extensions configurable, whereas this exposes the extensions and mimetypes of all built-in adapters for end-user configurability.
Output of
cargo run --bin=rga -- --rga-print-config-schema
from this branch.