Open andreamah opened 3 months ago
After talking to @jrieken, some notes:
WeakMap
for this case should work just fine.file
scheme.Extra: We should make sure that, if the cancellation token is cancelled, we don't listen to onProgress
anymore and possibly log an error (like here). Is there any case where we should still let the caller contribute results?
As an extra next-step, we should try to look through some of the options of these APIs to see what seems ripgrep-specific and unnecessary.
I have some notes on what work is left to finalize some popular proposed search APIs. I will put them in this issue.
API Explanation
Background
There are currently three search APIs that are quite old and need to be finalized:
API Info
Blockers
FileSearchProvider
Perf issue: for every URI that the extension sends, it must be serialized and deserialized again to be sent to the renderer process.
Uncertain element: does the caching work? There is a
FileSearchOptions.session
flag. We expect ext developers to have a map on their side that is used for caching. Here is an example.We should verify that something like this works.
There is a limitation of one provider per scheme, and the default provider already covers the
file
scheme. What if the user wants to install a third-party provider forfile
scheme searching? What if there are multiple providers for a custom scheme? For example, what if they want to replace ripgrep as their search engine?TextSearchProvider
FindTextInFiles
TextSearchProvider
. This API shares types ofTextSearchProvider
, which means that we should make sure that those are sane before finalizing thisExtra Considerations
TextSearchProvider
/FindTextInFiles
onProgress
calls, @jrieken might prefer to rather return something like the following:instead of the
onProgress
callback functions.