-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alberto Iannaccone
committed
Aug 11, 2022
1 parent
992fa84
commit 6044ff3
Showing
3 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 14 additions & 9 deletions
23
packages/plugin-ext/src/main/node/plugin-localization-backend-contribution.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
import { inject, injectable } from '@theia/core/shared/inversify'; | ||
import { LocalizationBackendContribution } from '@theia/core/lib/node/i18n/localization-backend-contribution'; | ||
import { PluginDeployer } from '../../common/plugin-protocol'; | ||
import { PluginDeployerImpl } from './plugin-deployer-impl'; | ||
import { Deferred } from '@theia/core/src/common/promise-util'; | ||
import { inject, injectable } from "@theia/core/shared/inversify"; | ||
import { LocalizationBackendContribution } from "@theia/core/lib/node/i18n/localization-backend-contribution"; | ||
import { PluginDeployer } from "../../common/plugin-protocol"; | ||
import { PluginDeployerImpl } from "./plugin-deployer-impl"; | ||
import { Deferred } from "@theia/core/lib/common/promise-util"; | ||
|
||
@injectable() | ||
export class PluginLocalizationBackendContribution extends LocalizationBackendContribution { | ||
@inject(PluginDeployer) | ||
protected readonly pluginDeployer: PluginDeployerImpl; | ||
protected readonly pluginsDeployed = new Deferred(); | ||
|
||
override async initialize(): Promise<void> { | ||
const pluginsDeployed = new Deferred(); | ||
this.pluginDeployer.onDidDeploy(() => { | ||
pluginsDeployed.resolve(); | ||
this.pluginsDeployed.resolve(); | ||
}); | ||
await super.initialize(); | ||
} | ||
|
||
await Promise.all([this.localizationRegistry.initialize(), pluginsDeployed.promise]); | ||
this.initialized.resolve(); | ||
override async waitForInitialization(): Promise<void> { | ||
await Promise.all([ | ||
super.waitForInitialization(), | ||
this.pluginsDeployed.promise, | ||
]); | ||
} | ||
} |