22 * Project: ESP-IDF VSCode Extension 
33 * File Created: Wednesday, 3rd November 2021 4:56:23 pm 
44 * Copyright 2021 Espressif Systems (Shanghai) CO LTD 
5-  *  
5+  *  
66 * Licensed under the Apache License, Version 2.0 (the "License"); 
77 * you may not use this file except in compliance with the License. 
88 * You may obtain a copy of the License at 
9-  *  
9+  *  
1010 *    http://www.apache.org/licenses/LICENSE-2.0 
11-  *  
11+  *  
1212 * Unless required by applicable law or agreed to in writing, software 
1313 * distributed under the License is distributed on an "AS IS" BASIS, 
1414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
@@ -20,18 +20,15 @@ import { ensureDir } from "fs-extra";
2020import  {  join  }  from  "path" ; 
2121import  { 
2222  TaskPanelKind , 
23-   ProcessExecutionOptions , 
2423  TaskPresentationOptions , 
2524  TaskRevealKind , 
2625  TaskScope , 
2726  Uri , 
2827  workspace , 
29-   ProcessExecution , 
3028}  from  "vscode" ; 
3129import  {  NotificationMode ,  readParameter  }  from  "../../idfConfiguration" ; 
3230import  {  TaskManager  }  from  "../../taskManager" ; 
33- import  {  appendIdfAndToolsToPath  }  from  "../../utils" ; 
34- import  {  getProjectName  }  from  "../../workspaceConfig" ; 
31+ import  {  appendIdfAndToolsToPath ,  readProjectCMakeLists  }  from  "../../utils" ; 
3532import  {  getVirtualEnvPythonPath  }  from  "../../pythonManager" ; 
3633import  {  OutputCapturingExecution  }  from  "../../taskManager/customExecution" ; 
3734
@@ -47,15 +44,15 @@ export class IdfSizeTask {
4744    this . buildDirPath  =  readParameter ( "idf.buildPath" ,  workspaceUri )  as  string ; 
4845  } 
4946
50-   private  async   mapFilePath ( )  { 
51-     const  projectName  =  await   getProjectName ( this . buildDirPath ) ; 
47+   private  mapFilePath ( )  { 
48+     const  projectName  =  readProjectCMakeLists ( this . currentWorkspace . fsPath ) ; 
5249    return  join ( this . buildDirPath ,  `${ projectName }  ) ; 
5350  } 
5451
5552  public  async  getSizeInfo ( )  { 
5653    await  ensureDir ( this . buildDirPath ) ; 
5754    const  pythonCommand  =  await  getVirtualEnvPythonPath ( this . currentWorkspace ) ; 
58-     const  mapFilePath  =  await   this . mapFilePath ( ) ; 
55+     const  mapFilePath  =  this . mapFilePath ( ) ; 
5956    const  args  =  [ this . idfSizePath ,  mapFilePath ] ; 
6057
6158    const  modifiedEnv  =  await  appendIdfAndToolsToPath ( this . currentWorkspace ) ; 
0 commit comments