Merge pull request #4115 from ajshedivy/vscode-api/update-submenu-items
VSCoce API: update submenu items on config reload
This commit is contained in:
commit
50f687d732
2 changed files with 19 additions and 0 deletions
|
|
@ -92,6 +92,17 @@ export class ConfigHandler {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the titles of additional context providers that are of type "submenu".
|
||||
*
|
||||
* @returns {string[]} An array of titles of the additional context providers that have a description type of "submenu".
|
||||
*/
|
||||
getAdditionalSubmenuContextProviders(): string[] {
|
||||
return this.additionalContextProviders
|
||||
.filter(provider => provider.description.type === "submenu")
|
||||
.map(provider => provider.description.title);
|
||||
}
|
||||
|
||||
private async init() {
|
||||
try {
|
||||
await this.fetchControlPlaneProfiles();
|
||||
|
|
|
|||
|
|
@ -128,6 +128,14 @@ export class Core {
|
|||
profileId:
|
||||
this.configHandler.currentProfile?.profileDescription.id ?? null,
|
||||
});
|
||||
|
||||
// update additional submenu context providers registered via VSCode API
|
||||
const additionalProviders = this.configHandler.getAdditionalSubmenuContextProviders();
|
||||
if (additionalProviders.length > 0) {
|
||||
this.messenger.send("refreshSubmenuItems", {
|
||||
providers: additionalProviders,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.configHandler.onDidChangeAvailableProfiles(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue