MCPcopy
hub / github.com/microsoft/vscode-js-debug / applyDefaults

Function applyDefaults

src/configuration.ts:1131–1161  ·  view source on GitHub ↗
(
  config: AnyResolvingConfiguration,
  location?: 'local' | 'remote',
)

Source from the content-addressed store, hash-verified

1129 typeof config === 'object' && !!config && 'env' in config && 'envFile' in config;
1130
1131export function applyDefaults(
1132 config: AnyResolvingConfiguration,
1133 location?: 'local' | 'remote',
1134): AnyLaunchConfiguration {
1135 let configWithDefaults: AnyLaunchConfiguration;
1136 const defaultBrowserLocation = location === 'remote' ? ('ui' as const) : ('workspace' as const);
1137 switch (config.type) {
1138 case DebugType.Node:
1139 configWithDefaults = applyNodeDefaults(config);
1140 break;
1141 case DebugType.Edge:
1142 configWithDefaults = applyEdgeDefaults(config, defaultBrowserLocation);
1143 break;
1144 case DebugType.Chrome:
1145 configWithDefaults = applyChromeDefaults(config, defaultBrowserLocation);
1146 break;
1147 case DebugType.ExtensionHost:
1148 configWithDefaults = applyExtensionHostDefaults(config);
1149 break;
1150 case DebugType.Terminal:
1151 configWithDefaults = applyTerminalDefaults(config);
1152 break;
1153 case DebugType.EditorBrowser:
1154 configWithDefaults = applyEditorBrowserDefaults(config);
1155 break;
1156 default:
1157 throw assertNever(config, 'Unknown config: {value}');
1158 }
1159
1160 return resolveWorkspaceInConfig(configWithDefaults);
1161}
1162
1163/**
1164 * Removes optional properties from the config where ${workspaceFolder} is

Callers 5

bootMethod · 0.90
reportBootTelemetryMethod · 0.90
_restartMethod · 0.90
launchMethod · 0.90

Calls 8

assertNeverFunction · 0.90
applyNodeDefaultsFunction · 0.85
applyEdgeDefaultsFunction · 0.85
applyChromeDefaultsFunction · 0.85
applyTerminalDefaultsFunction · 0.85
resolveWorkspaceInConfigFunction · 0.85

Tested by

no test coverage detected