@@ -11,6 +11,7 @@ import { isEmpty, isEqual } from 'lodash';
1111import { WorkspaceStateManager } from '@/state' ;
1212import { coreAPI , kitManager } from '@/extension' ;
1313import {
14+ CoreKey ,
1415 createLogger ,
1516 IsLinux ,
1617 IsMacOS ,
@@ -98,8 +99,8 @@ export class CppProject implements Project {
9899 ) ;
99100 this . _buildDir = currentBuildDir ;
100101 const message = new QtWorkspaceConfigMessage ( this . folder ) ;
101- coreAPI ?. setValue ( this . folder , 'buildDir' , currentBuildDir ) ;
102- message . config . add ( 'buildDir' ) ;
102+ coreAPI ?. setValue ( this . folder , CoreKey . BUILD_DIR , currentBuildDir ) ;
103+ message . config . add ( CoreKey . BUILD_DIR ) ;
103104 logger . info (
104105 `Notifying coreAPI with message: ${ message . toString ( ) } `
105106 ) ;
@@ -123,12 +124,12 @@ export class CppProject implements Project {
123124 }
124125 const selectedKitPath = kit ? getQtInsRoot ( kit ) : undefined ;
125126 const message = new QtWorkspaceConfigMessage ( this . folder ) ;
126- coreAPI ?. setValue ( this . folder , 'selectedKitPath' , selectedKitPath ) ;
127- message . config . add ( 'selectedKitPath' ) ;
127+ coreAPI ?. setValue ( this . folder , CoreKey . SELECTED_KIT_PATH , selectedKitPath ) ;
128+ message . config . add ( CoreKey . SELECTED_KIT_PATH ) ;
128129
129130 const selectedQtPaths = kit ? getQtPathsExe ( kit ) : undefined ;
130- coreAPI ?. setValue ( this . folder , 'selectedQtPaths' , selectedQtPaths ) ;
131- message . config . add ( 'selectedQtPaths' ) ;
131+ coreAPI ?. setValue ( this . folder , CoreKey . SELECTED_QT_PATHS , selectedQtPaths ) ;
132+ message . config . add ( CoreKey . SELECTED_QT_PATHS ) ;
132133 logger . info ( `Notifying coreAPI with message: ${ message . toString ( ) } ` ) ;
133134 coreAPI ?. notify ( message ) ;
134135 }
@@ -424,14 +425,14 @@ export class CppProject implements Project {
424425 logger . info (
425426 `Setting selected kit path for ${ folder . uri . fsPath } to ${ selectedKitPath } `
426427 ) ;
427- coreAPI . setValue ( folder , 'selectedKitPath' , selectedKitPath ) ;
428+ coreAPI . setValue ( folder , CoreKey . SELECTED_KIT_PATH , selectedKitPath ) ;
428429 const selectedQtPaths = kit ? getQtPathsExe ( kit ) : undefined ;
429- coreAPI . setValue ( folder , 'selectedQtPaths' , selectedQtPaths ) ;
430+ coreAPI . setValue ( folder , CoreKey . SELECTED_QT_PATHS , selectedQtPaths ) ;
430431 logger . info (
431432 `Setting selected Qt paths for ${ folder . uri . fsPath } to ${ selectedQtPaths } `
432433 ) ;
433434
434- const featuresKey = 'workspaceFeatures' ;
435+ const featuresKey = CoreKey . WORKSPACE_FEATURES ;
435436 let features = coreAPI . getValue < QtWorkspaceFeatures > ( folder , featuresKey ) ;
436437 features ??= { projectTypes : { } } ;
437438 features . projectTypes . cmake = true ;
@@ -441,16 +442,16 @@ export class CppProject implements Project {
441442 `Setting workspace features for ${ folder . uri . fsPath } to ${ JSON . stringify ( features ) } `
442443 ) ;
443444
444- coreAPI . setValue ( folder , 'buildDir' , this . buildDir ) ;
445+ coreAPI . setValue ( folder , CoreKey . BUILD_DIR , this . buildDir ) ;
445446 logger . info (
446447 `Setting build directory for ${ folder . uri . fsPath } to ${ this . buildDir } `
447448 ) ;
448449 logger . info ( 'Config values initialized for:' , folder . uri . fsPath ) ;
449450 const message = new QtWorkspaceConfigMessage ( folder ) ;
450- message . config . add ( 'selectedKitPath' ) ;
451- message . config . add ( 'selectedQtPaths' ) ;
451+ message . config . add ( CoreKey . SELECTED_KIT_PATH ) ;
452+ message . config . add ( CoreKey . SELECTED_QT_PATHS ) ;
452453 message . config . add ( featuresKey ) ;
453- message . config . add ( 'buildDir' ) ;
454+ message . config . add ( CoreKey . BUILD_DIR ) ;
454455 coreAPI . notify ( message ) ;
455456 }
456457 public getStateManager ( ) {
0 commit comments