提交 a6bbbf58 编写于 作者: J Johannes Rieken

take glob-match off the critical path when adding a new model, #5539

上级 85e02717
......@@ -74,20 +74,25 @@ export class ExtensionTipsService implements IExtensionTipsService {
return;
}
forEach(this._availableRecommendations, entry => {
let {key: pattern, value: ids} = entry;
if (match(pattern, uri.fsPath)) {
for (let id of ids) {
this._recommendations[id] = true;
// re-schedule this bit of the operation to be off
// the critical path - in case glob-match is slow
setImmediate(() => {
forEach(this._availableRecommendations, entry => {
let {key: pattern, value: ids} = entry;
if (match(pattern, uri.fsPath)) {
for (let id of ids) {
this._recommendations[id] = true;
}
}
}
});
});
this._storageService.store(
'extensionsAssistant/recommendations',
JSON.stringify(Object.keys(this._recommendations)),
StorageScope.GLOBAL
);
this._storageService.store(
'extensionsAssistant/recommendations',
JSON.stringify(Object.keys(this._recommendations)),
StorageScope.GLOBAL
);
});
}
dispose() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册