提交 6cc7eea6 编写于 作者: R Rachel Macfarlane

Ensure list of language ids gets populated when calling getLanguageIds before...

Ensure list of language ids gets populated when calling getLanguageIds before extension install/uninstall
上级 bf5e12e9
......@@ -93,6 +93,7 @@ class LanguagePacksCache extends Disposable {
private languagePacks: { [language: string]: ILanguagePack } = {};
private languagePacksFilePath: string;
private languagePacksFileLimiter: Queue<any>;
private initializedCache: boolean;
constructor(
@IEnvironmentService environmentService: IEnvironmentService,
......@@ -105,7 +106,7 @@ class LanguagePacksCache extends Disposable {
getLanguagePacks(): Promise<{ [language: string]: ILanguagePack }> {
// if queue is not empty, fetch from disk
if (this.languagePacksFileLimiter.size) {
if (this.languagePacksFileLimiter.size || !this.initializedCache) {
return this.withLanguagePacks()
.then(() => this.languagePacks);
}
......@@ -175,6 +176,7 @@ class LanguagePacksCache extends Disposable {
}
}
this.languagePacks = languagePacks;
this.initializedCache = true;
const raw = JSON.stringify(this.languagePacks);
this.logService.debug('Writing language packs', raw);
return pfs.writeFile(this.languagePacksFilePath, raw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册