@@ -174,16 +174,12 @@ export default class DebugUtils {
174174 for ( let i = 0 ; i < launchConfigs . length ; i ++ ) {
175175 const existingLaunch : vscode . DebugConfiguration = launchConfigs [ i ] ;
176176 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 ) ;
178179
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 ;
187183 break ;
188184 }
189185 }
@@ -210,10 +206,15 @@ export default class DebugUtils {
210206
211207 private static readonly RQ_ATTACH : string = "attach" ; // non-nls
212208
213- private static generateDebugLaunchConfig ( debugName : string , project : Project ) : vscode . DebugConfiguration | undefined {
209+ private static generateDebugLaunchConfig ( debugName : string , project : Project ) : vscode . DebugConfiguration {
214210
215211 switch ( project . type . debugType ) {
216212 case ProjectType . DebugTypes . JAVA : {
213+ let timeout = 30 * 1000 ;
214+ if ( project . type . isAppsody ) {
215+ timeout = 180 * 1000 ;
216+ }
217+
217218 return {
218219 type : project . type . debugType . toString ( ) ,
219220 name : debugName ,
@@ -222,6 +223,7 @@ export default class DebugUtils {
222223 port : project . exposedDebugPort ,
223224 // sourcePaths: project.localPath + "/src/"
224225 projectName : project . name ,
226+ timeout,
225227 } ;
226228 }
227229 case ProjectType . DebugTypes . NODE : {
@@ -238,7 +240,7 @@ export default class DebugUtils {
238240 } ;
239241 }
240242 default :
241- return undefined ;
243+ throw new Error ( "No debug type set for " + project . name ) ;
242244 }
243245 }
244246}
0 commit comments