Skip to content

Commit

Permalink
update cmd references
Browse files Browse the repository at this point in the history
  • Loading branch information
brianignacio5 committed Sep 27, 2024
1 parent 5ffc5fb commit 1fc799e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 47 deletions.
5 changes: 5 additions & 0 deletions src/cmdTreeView/cmdStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export interface IDFCommandDescription {
tooltip: string;
}

export enum IDFWebCommandKeys {
Flash = "espIdfWeb.flash",
Monitor = "espIdfWeb.monitor"
}

export enum CommandKeys {
pickWorkspace = "espIdf.pickAWorkspaceFolder",
SelectCurrentIdfVersion = "espIdf.selectCurrentIdfVersion",
Expand Down
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ import {
createStatusBarItem,
statusBarItems,
} from "./statusBar";
import { CommandKeys, createCommandDictionary } from "./cmdTreeView/cmdStore";
import { CommandKeys, createCommandDictionary, IDFWebCommandKeys } from "./cmdTreeView/cmdStore";

// Global variables shared by commands
let workspaceRoot: vscode.Uri;
Expand Down Expand Up @@ -3713,7 +3713,7 @@ const flash = (
PreCheck.perform([openFolderCheck], async () => {
// Re route to ESP-IDF Web extension if using Codespaces or Browser
if (vscode.env.uiKind === vscode.UIKind.Web) {
vscode.commands.executeCommand("esp-idf-web.flash");
vscode.commands.executeCommand(IDFWebCommandKeys.Flash);
return;
}
const notificationMode = idfConf.readParameter(
Expand Down Expand Up @@ -3936,7 +3936,7 @@ function createMonitor() {
PreCheck.perform([openFolderCheck], async () => {
// Re route to ESP-IDF Web extension if using Codespaces or Browser
if (vscode.env.uiKind === vscode.UIKind.Web) {
vscode.commands.executeCommand("esp-idf-web.monitor");
vscode.commands.executeCommand(IDFWebCommandKeys.Monitor);
return;
}
const noReset = idfConf.readParameter(
Expand Down
94 changes: 50 additions & 44 deletions src/statusBar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
*/

import {
l10n,
env,
StatusBarAlignment,
StatusBarItem,
TreeItemCheckboxState,
UIKind,
Uri,
window,
} from "vscode";
Expand Down Expand Up @@ -64,7 +65,6 @@ export async function createCmdsStatusBarItems(workspaceFolder: Uri) {
}
let currentIdfVersion = await getCurrentIdfSetup(workspaceFolder, false);


statusBarItems["workspace"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.pickWorkspace].iconId})`,
commandDictionary[CommandKeys.pickWorkspace].tooltip,
Expand All @@ -83,21 +83,25 @@ export async function createCmdsStatusBarItems(workspaceFolder: Uri) {
commandDictionary[CommandKeys.SelectCurrentIdfVersion].checkboxState
);

statusBarItems["flashType"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.SelectFlashType].iconId}) ${flashType}`,
commandDictionary[CommandKeys.SelectFlashType].tooltip,
CommandKeys.SelectFlashType,
101,
commandDictionary[CommandKeys.SelectFlashType].checkboxState
);
if (env.uiKind !== UIKind.Web) {
statusBarItems["flashType"] = createStatusBarItem(
`$(${
commandDictionary[CommandKeys.SelectFlashType].iconId
}) ${flashType}`,
commandDictionary[CommandKeys.SelectFlashType].tooltip,
CommandKeys.SelectFlashType,
101,
commandDictionary[CommandKeys.SelectFlashType].checkboxState
);

statusBarItems["port"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.SelectSerialPort].iconId}) ${port}`,
commandDictionary[CommandKeys.SelectSerialPort].tooltip,
CommandKeys.SelectSerialPort,
100,
commandDictionary[CommandKeys.SelectSerialPort].checkboxState
);
statusBarItems["port"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.SelectSerialPort].iconId}) ${port}`,
commandDictionary[CommandKeys.SelectSerialPort].tooltip,
CommandKeys.SelectSerialPort,
100,
commandDictionary[CommandKeys.SelectSerialPort].checkboxState
);
}

if (projectConf) {
statusBarItems["projectConf"] = createStatusBarItem(
Expand Down Expand Up @@ -141,34 +145,36 @@ export async function createCmdsStatusBarItems(workspaceFolder: Uri) {
95,
commandDictionary[CommandKeys.Build].checkboxState
);
statusBarItems["flash"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.Flash].iconId})`,
commandDictionary[CommandKeys.Flash].tooltip,
CommandKeys.Flash,
94,
commandDictionary[CommandKeys.Flash].checkboxState
);
statusBarItems["monitor"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.Monitor].iconId})`,
commandDictionary[CommandKeys.Monitor].tooltip,
CommandKeys.Monitor,
93,
commandDictionary[CommandKeys.Monitor].checkboxState
);
statusBarItems["debug"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.Debug].iconId})`,
commandDictionary[CommandKeys.Debug].tooltip,
CommandKeys.Debug,
92,
commandDictionary[CommandKeys.Debug].checkboxState
);
statusBarItems["buildFlashMonitor"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.BuildFlashMonitor].iconId})`,
commandDictionary[CommandKeys.BuildFlashMonitor].tooltip,
CommandKeys.BuildFlashMonitor,
91,
commandDictionary[CommandKeys.BuildFlashMonitor].checkboxState
);
if (env.uiKind !== UIKind.Web) {
statusBarItems["flash"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.Flash].iconId})`,
commandDictionary[CommandKeys.Flash].tooltip,
CommandKeys.Flash,
94,
commandDictionary[CommandKeys.Flash].checkboxState
);
statusBarItems["monitor"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.Monitor].iconId})`,
commandDictionary[CommandKeys.Monitor].tooltip,
CommandKeys.Monitor,
93,
commandDictionary[CommandKeys.Monitor].checkboxState
);
statusBarItems["debug"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.Debug].iconId})`,
commandDictionary[CommandKeys.Debug].tooltip,
CommandKeys.Debug,
92,
commandDictionary[CommandKeys.Debug].checkboxState
);
statusBarItems["buildFlashMonitor"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.BuildFlashMonitor].iconId})`,
commandDictionary[CommandKeys.BuildFlashMonitor].tooltip,
CommandKeys.BuildFlashMonitor,
91,
commandDictionary[CommandKeys.BuildFlashMonitor].checkboxState
);
}
statusBarItems["terminal"] = createStatusBarItem(
`$(${commandDictionary[CommandKeys.IDFTerminal].iconId})`,
commandDictionary[CommandKeys.IDFTerminal].tooltip,
Expand Down

0 comments on commit 1fc799e

Please sign in to comment.