MCPcopy
hub / github.com/microsoft/vscode / configureCommandlineSwitchesSync

Function configureCommandlineSwitchesSync

src/main.ts:223–368  ·  view source on GitHub ↗
(cliArgs: NativeParsedArgs)

Source from the content-addressed store, hash-verified

221}
222
223function configureCommandlineSwitchesSync(cliArgs: NativeParsedArgs) {
224 const SUPPORTED_ELECTRON_SWITCHES = [
225
226 // alias from us for --disable-gpu
227 'disable-hardware-acceleration',
228
229 // override for the color profile to use
230 'force-color-profile',
231
232 // disable LCD font rendering, a Chromium flag
233 'disable-lcd-text',
234
235 // bypass any specified proxy for the given semi-colon-separated list of hosts
236 'proxy-bypass-list',
237
238 'remote-debugging-port'
239 ];
240
241 if (process.platform === 'linux') {
242
243 // Force enable screen readers on Linux via this flag
244 SUPPORTED_ELECTRON_SWITCHES.push('force-renderer-accessibility');
245
246 // override which password-store is used on Linux
247 SUPPORTED_ELECTRON_SWITCHES.push('password-store');
248 }
249
250 const SUPPORTED_MAIN_PROCESS_SWITCHES = [
251
252 // Persistently enable proposed api via argv.json: https://github.com/microsoft/vscode/issues/99775
253 'enable-proposed-api',
254
255 // Log level to use. Default is 'info'. Allowed values are 'error', 'warn', 'info', 'debug', 'trace', 'off'.
256 'log-level',
257
258 // Use an in-memory storage for secrets
259 'use-inmemory-secretstorage',
260
261 // Enables display tracking to restore maximized windows under RDP: https://github.com/electron/electron/issues/47016
262 'enable-rdp-display-tracking',
263 ];
264
265 // Read argv config
266 const argvConfig = readArgvConfigSync();
267
268 Object.keys(argvConfig).forEach(argvKey => {
269 const argvValue = argvConfig[argvKey];
270
271 // Append Electron flags to Electron
272 if (SUPPORTED_ELECTRON_SWITCHES.indexOf(argvKey) !== -1) {
273 if (argvValue === true || argvValue === 'true') {
274 if (argvKey === 'disable-hardware-acceleration') {
275 app.disableHardwareAcceleration(); // needs to be called explicitly
276 } else {
277 app.commandLine.appendSwitch(argvKey);
278 }
279 } else if (typeof argvValue === 'string' && argvValue) {
280 if (argvKey === 'password-store') {

Callers 1

main.tsFile · 0.85

Calls 8

readArgvConfigSyncFunction · 0.85
getJSFlagsFunction · 0.85
isArrayMethod · 0.80
pushMethod · 0.65
forEachMethod · 0.65
keysMethod · 0.65
indexOfMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…