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

Function readArgvConfigSync

src/main.ts:388–409  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

386}
387
388function readArgvConfigSync(): IArgvConfig {
389
390 // Read or create the argv.json config file sync before app('ready')
391 const argvConfigPath = getArgvConfigPath();
392 let argvConfig: IArgvConfig | undefined = undefined;
393 try {
394 argvConfig = parse(fs.readFileSync(argvConfigPath).toString());
395 } catch (error) {
396 if (error && error.code === 'ENOENT') {
397 createDefaultArgvConfigSync(argvConfigPath);
398 } else {
399 console.warn(`Unable to read argv.json configuration file in ${argvConfigPath}, falling back to defaults (${error})`);
400 }
401 }
402
403 // Fallback to default
404 if (!argvConfig) {
405 argvConfig = {};
406 }
407
408 return argvConfig;
409}
410
411function createDefaultArgvConfigSync(argvConfigPath: string): void {
412 try {

Callers 1

Calls 5

parseFunction · 0.90
getArgvConfigPathFunction · 0.85
toStringMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…