-
Notifications
You must be signed in to change notification settings - Fork 29k
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
Allow extensions to control order of FileSearch results #83462
Comments
(Experimental duplicate detection) |
Yes, I would definitely like to allow search providers to control the ordering of matches |
If someone were to contribute this change, do you have any suggestions on the new API signature? Would it need to be backwards-compatible or could it use a new type? |
I kind of like the idea of just including an optional 'score' on the result. The questions I have are
Anyway I am open to taking a PR for this so you can try it out. I will definitely be working on search API again at some point but can't say when exactly that will be... |
Currently the 'proposed' API lets extensions provide file search results with a list of URIs:
vscode/src/vs/vscode.proposed.d.ts
Lines 338 to 346 in df17be4
However the results are re-ordered in
openAnythingHandler
:vscode/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts
Lines 125 to 127 in e65a9f0
The problem is my file search results are already sorted by my relevance metric, but our extension has no control over how they are displayed.
Idea: Add
score
parameter to the proposed API return value, so it would become{uri: Uri, score: number}[]
, and use the score when displaying resultsSimilar to #73904
The text was updated successfully, but these errors were encountered: