]> Git Repo - pico-vscode.git/commitdiff
Added reload window button after SDK change
authorpaulober <[email protected]>
Wed, 8 May 2024 14:31:30 +0000 (16:31 +0200)
committerpaulober <[email protected]>
Wed, 8 May 2024 14:31:30 +0000 (16:31 +0200)
Signed-off-by: paulober <[email protected]>
src/commands/switchSDK.mts

index 294b01fa080bfc008edb850aedb2f4f7ffb5b2a3..d8b2062e23012f1831956545de1579f0cc20e0f4 100644 (file)
@@ -1,5 +1,11 @@
 import { Command } from "./command.mjs";
-import { ProgressLocation, type Uri, window, workspace } from "vscode";
+import {
+  ProgressLocation,
+  type Uri,
+  window,
+  workspace,
+  commands,
+} from "vscode";
 import type UI from "../ui.mjs";
 import { updateVSCodeStaticConfigs } from "../utils/vscodeConfigUtil.mjs";
 import {
@@ -477,6 +483,18 @@ export default class SwitchSDKCommand extends Command {
 
     if (result) {
       this._ui.updateSDKVersion(selectedSDK.label.replace("v", ""));
+
+      const reloadWindowBtn = "Reload Window";
+      // notify user that reloading the window is
+      // recommended to update intellisense
+      const reload = await window.showInformationMessage(
+        "It is recommended to reload the window to update intellisense with the new SDK version.",
+        reloadWindowBtn
+      );
+
+      if (reload === reloadWindowBtn) {
+        commands.executeCommand("workbench.action.reloadWindow");
+      }
     }
   }
 }
This page took 0.033124 seconds and 4 git commands to generate.