mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
smoke - actually retry quick access usage
This commit is contained in:
parent
d338a3a0d0
commit
fdc4b7101d
|
@ -45,27 +45,31 @@ export class QuickAccess {
|
|||
while (++retries < 10) {
|
||||
let retry = false;
|
||||
|
||||
await this.openQuickAccess(fileName);
|
||||
try {
|
||||
await this.openQuickAccess(fileName);
|
||||
|
||||
await this.quickInput.waitForQuickInputElements(names => {
|
||||
const name = names[0];
|
||||
if (exactMatch && name === fileName) {
|
||||
fileFound = true;
|
||||
return true;
|
||||
}
|
||||
await this.quickInput.waitForQuickInputElements(names => {
|
||||
const name = names[0];
|
||||
if (exactMatch && name === fileName) {
|
||||
fileFound = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (name === 'No matching results') {
|
||||
retry = true;
|
||||
return true;
|
||||
}
|
||||
if (name === 'No matching results') {
|
||||
retry = true;
|
||||
return true; // search does not seem to be ready yet
|
||||
}
|
||||
|
||||
if (!exactMatch) {
|
||||
fileFound = true;
|
||||
return !!name;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (!exactMatch) {
|
||||
fileFound = true;
|
||||
return !!name;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
retry = true; // `waitForQuickInputElements` throws when elements not found
|
||||
}
|
||||
|
||||
if (!retry) {
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue