( config: AnyResolvingConfiguration, location?: 'local' | 'remote', )
| 1129 | typeof config === 'object' && !!config && 'env' in config && 'envFile' in config; |
| 1130 | |
| 1131 | export 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 |
no test coverage detected