Skip to content

Commit 19f2b34

Browse files
authored
Changed package.json to render on startup and added timer to trigger a rerender after 100ms of startup. (#173)
1 parent 1557be2 commit 19f2b34

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,9 @@
2626
"Other"
2727
],
2828
"activationEvents": [
29-
"zephyr-ide.get-active-project-name",
30-
"zephyr-ide.get-active-project-path",
31-
"zephyr-ide.get-active-build-path",
32-
"zephyr-ide.get-active-build-board-path",
33-
"zephyr-ide.select-active-build-path",
34-
"zephyr-ide.get-gdb-path",
35-
"zephyr-ide.get-toolchain-path",
36-
"zephyr-ide.get-zephyr-ide-json-variable",
37-
"zephyr-ide.get-active-project-variable",
38-
"zephyr-ide.get-active-build-variable",
39-
"zephyr-ide.get-active-board-name",
40-
"workspaceContains:.vscode/zephyr-ide.json"
29+
"onStartupFinished",
30+
"workspaceContains:.vscode/zephyr-ide.json",
31+
"onViewContainer:zephyr-ide-main"
4132
],
4233
"main": "./dist/extension.js",
4334
"contributes": {
@@ -166,6 +157,10 @@
166157
]
167158
},
168159
"commands": [
160+
{
161+
"command": "zephyr-ide.show-container",
162+
"title": "Zephyr IDE: Show View Container"
163+
},
169164
{
170165
"command": "zephyr-ide.check-build-dependencies",
171166
"title": "Zephyr IDE: Setup Check Build Dependencies Available"

src/extension.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,15 +1105,36 @@ export async function activate(context: vscode.ExtensionContext) {
11051105
)
11061106
);
11071107

1108+
context.subscriptions.push(
1109+
vscode.commands.registerCommand("zephyr-ide.show-container", async () => {
1110+
// Reveal any view inside our container; this triggers container visibility
1111+
await vscode.commands.executeCommand("workbench.view.extension.zephyr-ide-main");
1112+
})
1113+
);
1114+
11081115
context.subscriptions.push(
11091116
vscode.commands.registerCommand("zephyr-ide.update-web-view", async () => {
11101117
activeProjectView.updateWebView(wsConfig);
11111118
projectTreeView.updateWebView(wsConfig);
11121119
projectConfigView.updateWebView(wsConfig);
1120+
// Ensure the setup panel stays in sync as well
1121+
extensionSetupView.updateWebView(wsConfig, globalConfig);
1122+
if (SetupPanel.currentPanel) {
1123+
SetupPanel.currentPanel.updateContent(wsConfig, globalConfig);
1124+
}
11131125
vscode.commands.executeCommand("zephyr-ide.update-status");
11141126
})
11151127
);
11161128

1129+
// Kick an initial refresh shortly after activation so views render even if no command ran yet
1130+
setTimeout(() => {
1131+
try {
1132+
vscode.commands.executeCommand("zephyr-ide.update-web-view");
1133+
} catch (e) {
1134+
console.error("Zephyr IDE: initial webview refresh failed", e);
1135+
}
1136+
}, 100);
1137+
11171138
context.subscriptions.push(
11181139
vscode.commands.registerCommand("zephyr-ide.start-menu-config", async () => {
11191140
buildMenuConfig(wsConfig, MenuConfig.MenuConfig);

0 commit comments

Comments
 (0)