@@ -120,7 +120,8 @@ interface SubmitMessageValue extends ImportProjectMessageValue {
120120
121121export interface WebviewMessage {
122122 command : string ;
123- value : object | string | SubmitMessageValue ;
123+ value : object | string | SubmitMessageValue | boolean ;
124+ key ?: string ;
124125}
125126
126127enum BoardType {
@@ -768,6 +769,20 @@ export class NewProjectPanel {
768769 ) ;
769770 }
770771 break ;
772+ case 'updateSetting' :
773+ {
774+ const key = message . key as string ;
775+ const value = message . value as boolean ;
776+ switch ( key ) {
777+ case "cmakeTools" :
778+ await this . _settings . setCMakeToolsPref ( value ) ;
779+ break ;
780+ case "entryProjectName" :
781+ await this . _settings . setEntryPointNamingPref ( value ) ;
782+ break ;
783+ }
784+ }
785+ break ;
771786 }
772787 } ,
773788 null ,
@@ -1633,8 +1648,11 @@ export class NewProjectPanel {
16331648 // Restrict the webview to only load specific scripts
16341649 const nonce = getNonce ( ) ;
16351650 const isWindows = process . platform === "win32" ;
1651+
1652+ // Get the default values from global state
16361653 const useProjectNameAsEntryPointFileName =
16371654 this . _settings . getEntryPointNamingPref ( ) ;
1655+ const defaultUseCmakeTools = this . _settings . getCMakeToolsPref ( ) ;
16381656
16391657 return `<!DOCTYPE html>
16401658 <html lang="en">
@@ -2163,11 +2181,15 @@ export class NewProjectPanel {
21632181 </div>
21642182 </div>
21652183 </div>
2166- <div id="section-extension-integration" class="snap-end advanced-option" hidden >
2184+ <div id="section-extension-integration" class="snap-end" >
21672185 <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-8">CMake Tools</h3>
21682186 <div class="flex items-stretch space-x-4">
21692187 <div class="flex items-center px-4 py-2 border border-gray-200 rounded dark:border-gray-700">
2170- <input id="use-cmake-tools-cb" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 outline-none focus:ring-0 focus:ring-offset-5 dark:bg-gray-700 dark:border-gray-600">
2188+ <input id="use-cmake-tools-cb" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 outline-none focus:ring-0 focus:ring-offset-5 dark:bg-gray-700 dark:border-gray-600" ${
2189+ defaultUseCmakeTools
2190+ ? 'checked'
2191+ : ''
2192+ } >
21712193 <label for="use-cmake-tools-cb" class="w-full py-4 ml-2 text-sm font-medium text-gray-900 dark:text-gray-300">Enable CMake-Tools extension integration</label>
21722194 </div>
21732195 </div>
0 commit comments