提交 6ca1b755 编写于 作者: B Benjamin Pasero

💄

上级 6c690f5b
......@@ -139,7 +139,7 @@ export class OpenFileHandler extends QuickOpenHandler {
this.options = options;
}
getResults(searchValue: string, maxSortedResults?: number, token?: CancellationToken): TPromise<FileQuickOpenModel> {
getResults(searchValue: string, maxSortedResults?: number, token: CancellationToken = CancellationToken.None): TPromise<FileQuickOpenModel> {
const query = prepareQuery(searchValue);
// Respond directly to empty search
......
......@@ -150,12 +150,18 @@ export class OpenSymbolHandler extends QuickOpenHandler {
return true;
}
public getResults(searchValue: string, token?: CancellationToken): TPromise<QuickOpenModel> {
public getResults(searchValue: string, token: CancellationToken = CancellationToken.None): TPromise<QuickOpenModel> {
searchValue = searchValue.trim();
let promise: TPromise<QuickOpenEntry[]>;
if (!this.options.skipDelay) {
promise = this.delayer.trigger(() => this.doGetResults(searchValue, token)); // Run search with delay as needed
promise = this.delayer.trigger(() => {
if (token.isCancellationRequested) {
return TPromise.wrap([]);
}
return this.doGetResults(searchValue, token);
});
} else {
promise = this.doGetResults(searchValue, token);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册