@@ -174,16 +174,12 @@ export default class DebugUtils {
174
174
for ( let i = 0 ; i < launchConfigs . length ; i ++ ) {
175
175
const existingLaunch : vscode . DebugConfiguration = launchConfigs [ i ] ;
176
176
if ( existingLaunch != null && existingLaunch . name === debugName ) {
177
- const updatedLaunch = DebugUtils . generateDebugLaunchConfig ( debugName , project ) ;
177
+ const newLaunch = DebugUtils . generateDebugLaunchConfig ( debugName , project ) ;
178
+ const mergedLaunch = Object . assign ( existingLaunch , newLaunch ) ;
178
179
179
- if ( updatedLaunch == null ) {
180
- Log . e ( `Failed to generate debug launch config for ${ project . name } when a config already existed` ) ;
181
- continue ;
182
- }
183
-
184
- Log . d ( `Replacing existing debug launch ${ debugName } ` ) ;
185
- launchConfigs [ i ] = updatedLaunch ;
186
- launchToWrite = updatedLaunch ;
180
+ Log . d ( `Updating existing debug launch ${ debugName } ` ) ;
181
+ launchConfigs [ i ] = mergedLaunch ;
182
+ launchToWrite = mergedLaunch ;
187
183
break ;
188
184
}
189
185
}
@@ -210,10 +206,15 @@ export default class DebugUtils {
210
206
211
207
private static readonly RQ_ATTACH : string = "attach" ; // non-nls
212
208
213
- private static generateDebugLaunchConfig ( debugName : string , project : Project ) : vscode . DebugConfiguration | undefined {
209
+ private static generateDebugLaunchConfig ( debugName : string , project : Project ) : vscode . DebugConfiguration {
214
210
215
211
switch ( project . type . debugType ) {
216
212
case ProjectType . DebugTypes . JAVA : {
213
+ let timeout = 30 * 1000 ;
214
+ if ( project . type . isAppsody ) {
215
+ timeout = 180 * 1000 ;
216
+ }
217
+
217
218
return {
218
219
type : project . type . debugType . toString ( ) ,
219
220
name : debugName ,
@@ -222,6 +223,7 @@ export default class DebugUtils {
222
223
port : project . exposedDebugPort ,
223
224
// sourcePaths: project.localPath + "/src/"
224
225
projectName : project . name ,
226
+ timeout,
225
227
} ;
226
228
}
227
229
case ProjectType . DebugTypes . NODE : {
@@ -238,7 +240,7 @@ export default class DebugUtils {
238
240
} ;
239
241
}
240
242
default :
241
- return undefined ;
243
+ throw new Error ( "No debug type set for " + project . name ) ;
242
244
}
243
245
}
244
246
}
0 commit comments