diff --git a/src/settings.mts b/src/settings.mts index 424a743..aa5f3bb 100644 --- a/src/settings.mts +++ b/src/settings.mts @@ -33,6 +33,7 @@ export type GlobalStateType = Memento & { }; const LAST_PROJECT_ROOT_STATE_KEY = "lastProjectRoot"; +const ENTRY_POINT_NAMING_PREF = "entryPointNamingPref"; export default class Settings { private static instance?: Settings; @@ -140,4 +141,12 @@ export default class Settings { return Uri.file(fsPath); } + + public async setEntryPointNamingPref(useProjectName: boolean): Promise { + await this.globalState.update(ENTRY_POINT_NAMING_PREF, useProjectName); + } + + public getEntryPointNamingPref(): boolean { + return this.globalState.get(ENTRY_POINT_NAMING_PREF, true); + } } diff --git a/src/webview/newProjectPanel.mts b/src/webview/newProjectPanel.mts index bd738bf..e2a172f 100644 --- a/src/webview/newProjectPanel.mts +++ b/src/webview/newProjectPanel.mts @@ -1070,6 +1070,11 @@ export class NewProjectPanel { if (example === undefined && !this._isProjectImport) { const theData = data as SubmitMessageValue; + + await this._settings.setEntryPointNamingPref( + theData.entryPointProjectName + ); + const args: NewProjectOptions = { name: theData.projectName, projectRoot: projectPath, @@ -1433,6 +1438,8 @@ export class NewProjectPanel { // Restrict the webview to only load specific scripts const nonce = getNonce(); const isWindows = process.platform === "win32"; + const useProjectNameAsEntryPointFileName = + this._settings.getEntryPointNamingPref(); return ` @@ -1940,7 +1947,11 @@ export class NewProjectPanel {
  • - +