Skip to content

Commit 3e12445

Browse files
committed
Remove unnecessary optional markings from Settings
1 parent ccd3c7e commit 3e12445

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@
816816
"powershell.integratedConsole.suppressStartupBanner": {
817817
"type": "boolean",
818818
"default": false,
819-
"description": "Do not show the Powershell Extension Terminal banner on launch"
819+
"description": "Do not show the PowerShell Extension Terminal banner on launch."
820820
},
821821
"powershell.debugging.createTemporaryIntegratedConsole": {
822822
"type": "boolean",

src/process.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class PowerShellProcess {
4646
"PowerShellEditorServices/PowerShellEditorServices.psd1");
4747

4848
const featureFlags =
49-
this.sessionSettings.developer.featureFlags !== undefined
49+
this.sessionSettings.developer.featureFlags.length > 0
5050
? this.sessionSettings.developer.featureFlags.map((f) => `'${f}'`).join(", ")
5151
: "";
5252

src/settings.ts

+26-25
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export interface IBugReportingSettings {
3333
}
3434

3535
export interface ICodeFoldingSettings {
36-
enable?: boolean;
37-
showLastLine?: boolean;
36+
enable: boolean;
37+
showLastLine: boolean;
3838
}
3939

4040
export interface ICodeFormattingSettings {
@@ -60,46 +60,46 @@ export interface ICodeFormattingSettings {
6060
}
6161

6262
export interface IScriptAnalysisSettings {
63-
enable?: boolean;
63+
enable: boolean;
6464
settingsPath: string;
6565
}
6666

6767
export interface IDebuggingSettings {
68-
createTemporaryIntegratedConsole?: boolean;
68+
createTemporaryIntegratedConsole: boolean;
6969
}
7070

7171
export interface IDeveloperSettings {
72-
featureFlags?: string[];
72+
featureFlags: string[];
7373
bundledModulesPath: string;
7474
editorServicesLogLevel: string;
75-
editorServicesWaitForDebugger?: boolean;
75+
editorServicesWaitForDebugger: boolean;
7676
waitForSessionFileTimeoutSeconds: number;
7777
}
7878

7979
export interface ISettings {
80-
powerShellAdditionalExePaths?: IPowerShellAdditionalExePathSettings;
81-
powerShellDefaultVersion?: string;
80+
powerShellAdditionalExePaths: IPowerShellAdditionalExePathSettings | undefined;
81+
powerShellDefaultVersion: string | undefined;
8282
// This setting is no longer used but is here to assist in cleaning up the users settings.
83-
powerShellExePath?: string;
84-
promptToUpdatePowerShell?: boolean;
83+
powerShellExePath: string | undefined;
84+
promptToUpdatePowerShell: boolean;
8585
bundledModulesPath: string;
8686
startAsLoginShell: IStartAsLoginShellSettings;
87-
startAutomatically?: boolean;
87+
startAutomatically: boolean;
8888
enableProfileLoading: boolean;
8989
helpCompletion: string;
90-
scriptAnalysis?: IScriptAnalysisSettings;
90+
scriptAnalysis: IScriptAnalysisSettings;
9191
debugging: IDebuggingSettings;
9292
developer: IDeveloperSettings;
93-
codeFolding?: ICodeFoldingSettings;
94-
codeFormatting?: ICodeFormattingSettings;
93+
codeFolding: ICodeFoldingSettings;
94+
codeFormatting: ICodeFormattingSettings;
9595
integratedConsole: IIntegratedConsoleSettings;
9696
bugReporting: IBugReportingSettings;
9797
sideBar: ISideBarSettings;
9898
pester: IPesterSettings;
99-
buttons?: IButtonSettings;
100-
cwd?: string;
101-
enableReferencesCodeLens?: boolean;
102-
analyzeOpenDocumentsOnly?: boolean;
99+
buttons: IButtonSettings;
100+
cwd: string | undefined;
101+
enableReferencesCodeLens: boolean;
102+
analyzeOpenDocumentsOnly: boolean;
103103
}
104104

105105
export interface IStartAsLoginShellSettings {
@@ -108,12 +108,12 @@ export interface IStartAsLoginShellSettings {
108108
}
109109

110110
export interface IIntegratedConsoleSettings {
111-
showOnStartup?: boolean;
112-
startInBackground?: boolean;
111+
showOnStartup: boolean;
112+
startInBackground: boolean;
113113
focusConsoleOnExecute: boolean;
114-
useLegacyReadLine?: boolean;
115-
forceClearScrollbackBuffer?: boolean;
116-
suppressStartupBanner?: boolean;
114+
useLegacyReadLine: boolean;
115+
forceClearScrollbackBuffer: boolean;
116+
suppressStartupBanner: boolean;
117117
}
118118

119119
export interface ISideBarSettings {
@@ -127,8 +127,8 @@ export interface IPesterSettings {
127127
}
128128

129129
export interface IButtonSettings {
130-
showRunButtons?: boolean;
131-
showPanelMovementButtons?: boolean;
130+
showRunButtons: boolean;
131+
showPanelMovementButtons: boolean;
132132
}
133133

134134
// TODO: This could probably be async, and call `validateCwdSetting()` directly.
@@ -197,6 +197,7 @@ export function load(): ISettings {
197197
focusConsoleOnExecute: true,
198198
useLegacyReadLine: false,
199199
forceClearScrollbackBuffer: false,
200+
suppressStartupBanner: false,
200201
};
201202

202203
const defaultSideBarSettings: ISideBarSettings = {

0 commit comments

Comments
 (0)