-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
support for fastAndSlow picks #191002
support for fastAndSlow picks #191002
Conversation
src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts
Outdated
Show resolved
Hide resolved
return { | ||
picks: [], | ||
additionalPicks: Promise.resolve([]) | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return null
here maybe
src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts
Outdated
Show resolved
Hide resolved
return this.searchModel.searchResult.matches().filter(e => result.syncResults.indexOf(e) === -1); | ||
}; | ||
return { | ||
syncResults: this.searchModel.searchResult.matches(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not return result.syncResults
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matches()
in the searchresult are the non-raw matches
@@ -2046,11 +2075,21 @@ export class SearchModel extends Disposable { | |||
// In search on type case, delay the streaming of results just a bit, so that we don't flash the only "local results" fast path | |||
this._startStreamDelay = new Promise(resolve => setTimeout(resolve, this.searchConfig.searchOnType ? 150 : 0)); | |||
|
|||
const currentRequest = this.doSearch(query, progressEmitter, this._searchQuery, searchInstanceID, onProgress); | |||
const req = this.doSearch(query, progressEmitter, this._searchQuery, searchInstanceID, onProgress, callerTokenSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this ID for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Webview results in notebooks needs an owner ID so that we can add and remove decorations properly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's not part of this PR but I'd think you could do that without exposing this webview thing all the way up at this layer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason why it needs to be at the search model layer is because FileMatches
that are part of the same search need to know the searchInstanceID to correctly remove webview decorations. Saying "I send a command from the search view to remove decorations from the webview" did not work, as there was a race condition with the new search starting to add its decorations before the old search instance began to dispose. I created #191106 to track the polish of this work, as I agree it's strange to have this so far away from the webview work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from QuickAccess side!
Fixes #190767
Mostly refactors search to support sync results. This uses the
FastAndSlowPicks
API in quick access to return synchronous results before async results. Thesearch
function in theSearchModel
should now return a sync and async result (two results), where the async result should resolve at the same point that the original singlesearch
return value resolved.Sync results -> open text editors
Async results -> closed text editors, notebook (open editors and closed)
Related polish items:
ISearchComplete
result field #191023NotebookSearchService
to be called withISearchService
or related service #191024