@@ -47,6 +47,11 @@ async function getFileText(uri: vscode.Uri): Promise<string> {
47
47
}
48
48
}
49
49
50
+ /** Strip quotes from method `name` if present */
51
+ function stripMethodNameQuotes ( name : string ) : string {
52
+ return name . charAt ( 0 ) == '"' && name . charAt ( name . length - 1 ) == '"' ? name . slice ( 1 , - 1 ) . replaceAll ( '""' , '"' ) : name ;
53
+ }
54
+
50
55
/** converts a uri from VS Code to a server-side XDebug file URI with respect to source root settings */
51
56
async function convertClientPathToDebugger ( uri : vscode . Uri , namespace : string ) : Promise < string > {
52
57
const { scheme, path } = uri ;
@@ -313,6 +318,7 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
313
318
) {
314
319
// This breakpoint is in a method
315
320
const currentdoc = ( await getFileText ( uri ) ) . split ( / \r ? \n / ) ;
321
+ const methodName = stripMethodNameQuotes ( currentSymbol . name ) ;
316
322
if ( languageServer ) {
317
323
// selectionRange.start.line is the method definition line
318
324
for (
@@ -329,15 +335,15 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
329
335
breakpoint . condition ,
330
336
fileUri ,
331
337
line ,
332
- currentSymbol . name ,
338
+ methodName ,
333
339
line - methodlinenum - 1 ,
334
340
breakpoint . hitCondition
335
341
) ;
336
342
} else {
337
343
return new xdebug . ClassLineBreakpoint (
338
344
fileUri ,
339
345
line ,
340
- currentSymbol . name ,
346
+ methodName ,
341
347
line - methodlinenum - 1 ,
342
348
breakpoint . hitCondition
343
349
) ;
@@ -351,15 +357,15 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
351
357
breakpoint . condition ,
352
358
fileUri ,
353
359
line ,
354
- currentSymbol . name ,
360
+ methodName ,
355
361
line - currentSymbol . selectionRange . start . line ,
356
362
breakpoint . hitCondition
357
363
) ;
358
364
} else {
359
365
return new xdebug . ClassLineBreakpoint (
360
366
fileUri ,
361
367
line ,
362
- currentSymbol . name ,
368
+ methodName ,
363
369
line - currentSymbol . selectionRange . start . line ,
364
370
breakpoint . hitCondition
365
371
) ;
@@ -539,7 +545,10 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
539
545
// Find the DocumentSymbol for this method
540
546
let currentSymbol : vscode . DocumentSymbol ;
541
547
for ( const symbol of symbols ) {
542
- if ( symbol . name === stackFrame . method && symbol . detail . toLowerCase ( ) . includes ( "method" ) ) {
548
+ if (
549
+ stripMethodNameQuotes ( symbol . name ) === stackFrame . method &&
550
+ symbol . detail . toLowerCase ( ) . includes ( "method" )
551
+ ) {
543
552
currentSymbol = symbol ;
544
553
break ;
545
554
}
0 commit comments