From 0fa8e6c15e39a8e3e4669fe0e8e8de5acdc81380 Mon Sep 17 00:00:00 2001 From: Radu Date: Mon, 28 Oct 2024 15:14:10 +0200 Subject: [PATCH] Fix rebase --- src/extension.ts | 87 ++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 58 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index b8e2b6440..ce7d6ff38 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -404,7 +404,35 @@ export async function activate(context: vscode.ExtensionContext) { ); if (statusBarItems && statusBarItems["port"]) { statusBarItems["port"].text = - "$(plug) " + idfConf.readParameter("idf.port", workspaceRoot); + `$(${ + commandDictionary[CommandKeys.SelectSerialPort].iconId + }) ` + idfConf.readParameter("idf.port", workspaceRoot); + } + if (statusBarItems["projectConf"]) { + statusBarItems["projectConf"].dispose(); + statusBarItems["projectConf"] = undefined; + const selectedConfig = ESP.ProjectConfiguration.store.get( + ESP.ProjectConfiguration.SELECTED_CONFIG + ); + ESP.ProjectConfiguration.store.clear(selectedConfig); + ESP.ProjectConfiguration.store.clear( + ESP.ProjectConfiguration.SELECTED_CONFIG + ); + } + const currentIdfSetup = await getCurrentIdfSetup( + workspaceRoot, + false + ); + if (statusBarItems["currentIdfVersion"]) { + statusBarItems["currentIdfVersion"].text = currentIdfSetup.isValid + ? `$(${ + commandDictionary[CommandKeys.SelectCurrentIdfVersion] + .iconId + }) ESP-IDF v${currentIdfSetup.version}` + : `$(${ + commandDictionary[CommandKeys.SelectCurrentIdfVersion] + .iconId + }) ESP-IDF InvalidSetup`; } const coverageOptions = getCoverageOptions(workspaceRoot); covRenderer = new CoverageRenderer(workspaceRoot, coverageOptions); @@ -417,35 +445,6 @@ export async function activate(context: vscode.ExtensionContext) { workspaceRoot, statusBarItems["target"] ); - if (statusBarItems && statusBarItems["port"]) { - statusBarItems["port"].text = - `$(${commandDictionary[CommandKeys.SelectSerialPort].iconId}) ` + - idfConf.readParameter("idf.port", workspaceRoot); - } - if (statusBarItems["projectConf"]) { - statusBarItems["projectConf"].dispose(); - statusBarItems["projectConf"] = undefined; - const selectedConfig = ESP.ProjectConfiguration.store.get( - ESP.ProjectConfiguration.SELECTED_CONFIG - ); - ESP.ProjectConfiguration.store.clear(selectedConfig); - ESP.ProjectConfiguration.store.clear( - ESP.ProjectConfiguration.SELECTED_CONFIG - ); - } - const currentIdfSetup = await getCurrentIdfSetup( - workspaceRoot, - false - ); - if (statusBarItems["currentIdfVersion"]) { - statusBarItems["currentIdfVersion"].text = currentIdfSetup.isValid - ? `$(${ - commandDictionary[CommandKeys.SelectCurrentIdfVersion].iconId - }) ESP-IDF v${currentIdfSetup.version}` - : `$(${ - commandDictionary[CommandKeys.SelectCurrentIdfVersion].iconId - }) ESP-IDF InvalidSetup`; - } const coverageOptions = getCoverageOptions(workspaceRoot); covRenderer = new CoverageRenderer(workspaceRoot, coverageOptions); } @@ -464,35 +463,7 @@ export async function activate(context: vscode.ExtensionContext) { workspace: workspaceRoot, } as IOpenOCDConfig; openOCDManager.configureServer(openOCDConfig); - qemuManager.configure({ - workspaceFolder: workspaceRoot, - } as IQemuOptions); - await checkAndNotifyMissingCompileCommands(); } - if (typeof workspaceRoot === undefined) { - workspaceRoot = initSelectedWorkspace(statusBarItems["workspace"]); - await getIdfTargetFromSdkconfig( - workspaceRoot, - statusBarItems["target"] - ); - const coverageOptions = getCoverageOptions(workspaceRoot); - covRenderer = new CoverageRenderer(workspaceRoot, coverageOptions); - } - const buildDirPath = idfConf.readParameter( - "idf.buildPath", - workspaceRoot - ) as string; - const projectName = await getProjectName(buildDirPath); - const projectElfFile = `${path.join(buildDirPath, projectName)}.elf`; - const debugAdapterConfig = { - currentWorkspace: workspaceRoot, - elfFile: projectElfFile, - } as IDebugAdapterConfig; - debugAdapterManager.configureAdapter(debugAdapterConfig); - const openOCDConfig: IOpenOCDConfig = { - workspace: workspaceRoot, - } as IOpenOCDConfig; - openOCDManager.configureServer(openOCDConfig); ConfserverProcess.dispose(); }) );