Skip to content

Commit

Permalink
save settings on workspace folder
Browse files Browse the repository at this point in the history
  • Loading branch information
brianignacio5 committed Apr 10, 2024
1 parent e8f7772 commit 2ab2d92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2288,11 +2288,11 @@ export async function activate(context: vscode.ExtensionContext) {
});

registerIDFCommand("espIdf.installEspIdf", async () => {
await downloadEspIdf(context);
await downloadEspIdf(context, workspaceRoot);
});

registerIDFCommand("espIdf.useEspIdfJsonSetup", async () => {
await useExistingEspIdfJsonSetup();
await useExistingEspIdfJsonSetup(workspaceRoot);
});

registerIDFCommand("espIdf.importProject", async () => {
Expand Down
14 changes: 10 additions & 4 deletions src/setup/cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
ExtensionContext,
Progress,
ProgressLocation,
Uri,
window,
} from "vscode";
import { getEspIdfVersions } from "./espIdfVersionList";
Expand All @@ -42,7 +43,7 @@ import { downloadEspIdfTools } from "./toolInstall";
import { isBinInPath } from "../utils";
import { pathExists } from "fs-extra";

export async function useExistingEspIdfJsonSetup() {
export async function useExistingEspIdfJsonSetup(workspaceFolder: Uri) {
const containerPath =
process.platform === "win32" ? process.env.USERPROFILE : process.env.HOME;
let toolsPath = join(containerPath, ".espressif");
Expand Down Expand Up @@ -97,7 +98,8 @@ export async function useExistingEspIdfJsonSetup() {
exportedVars,
toolsPath,
espIdfVersion.gitPath,
ConfigurationTarget.Global
ConfigurationTarget.WorkspaceFolder,
workspaceFolder
);
}

Expand All @@ -115,7 +117,10 @@ export async function openFolder(openLabel: string) {
}
}

export async function downloadEspIdf(context: ExtensionContext) {
export async function downloadEspIdf(
context: ExtensionContext,
workspaceFolder: Uri
) {
const espIdfVersions = await getEspIdfVersions(context.extensionPath);

let quickPickItems = espIdfVersions.map((k) => {
Expand Down Expand Up @@ -300,7 +305,8 @@ export async function downloadEspIdf(context: ExtensionContext) {
exportedVars,
toolsPath,
idfGitPath,
ConfigurationTarget.Global
ConfigurationTarget.WorkspaceFolder,
workspaceFolder
);
}
);
Expand Down

0 comments on commit 2ab2d92

Please sign in to comment.