@@ -20,11 +20,7 @@ export async function getConfigurationsForWorkspace(workspace: WorkspaceFolder):
20
20
// no launch.json or no configurations found in launch.json, look in settings.json
21
21
if ( ! parsed || ! parsed . configurations ) {
22
22
traceLog ( 'No configurations found in launch.json, looking in settings.json.' ) ;
23
- const settingConfigs = getConfigurationsFromSettings ( workspace ) ;
24
- if ( settingConfigs . length === 0 ) {
25
- throw Error ( 'No configurations found in launch.json or settings.json' ) ;
26
- }
27
- return Promise . resolve ( settingConfigs ) ;
23
+ return getConfigurationsFromSettings ( workspace ) ;
28
24
}
29
25
// configurations found in launch.json, verify them then return
30
26
if ( ! Array . isArray ( parsed . configurations ) || parsed . configurations . length === 0 ) {
@@ -51,8 +47,12 @@ export function getConfigurationsFromSettings(workspace: WorkspaceFolder): Debug
51
47
// look in settings.json
52
48
const codeWorkspaceConfig = getConfiguration ( 'launch' , workspace ) ;
53
49
// if this includes user configs, how do I make sure it selects the workspace ones first
54
- if ( ! codeWorkspaceConfig . configurations || ! Array . isArray ( codeWorkspaceConfig . configurations ) ) {
55
- return [ ] ;
50
+ if (
51
+ ! codeWorkspaceConfig . configurations ||
52
+ ! Array . isArray ( codeWorkspaceConfig . configurations ) ||
53
+ codeWorkspaceConfig . configurations . length === 0
54
+ ) {
55
+ throw Error ( 'No configurations found in launch.json or settings.json' ) ;
56
56
}
57
57
traceLog ( 'Using configuration in workspace settings.json.' ) ;
58
58
return codeWorkspaceConfig . configurations ;
0 commit comments