@@ -45,7 +45,7 @@ export async function convertClientPathToDebugger(localPath: string, namespace:
45
45
if ( query . ns && query . ns !== "" ) {
46
46
namespace = query . ns . toString ( ) ;
47
47
}
48
- fileName = pathname . slice ( 1 ) ;
48
+ fileName = pathname . slice ( 1 ) . replace ( / \/ / , "." ) ;
49
49
} else {
50
50
fileName = await vscode . workspace
51
51
. openTextDocument ( localPath )
@@ -55,6 +55,8 @@ export async function convertClientPathToDebugger(localPath: string, namespace:
55
55
} ) ;
56
56
}
57
57
58
+ namespace = encodeURIComponent ( namespace ) ;
59
+ fileName = encodeURIComponent ( fileName ) ;
58
60
return `dbgp://|${ namespace } |${ fileName } ` ;
59
61
}
60
62
@@ -204,6 +206,7 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
204
206
await this . _debugTargetSet . wait ( 1000 ) ;
205
207
206
208
const filePath = args . source . path ;
209
+ const uri = filePath . startsWith ( FILESYSTEM_SCHEMA ) ? vscode . Uri . parse ( filePath ) : vscode . Uri . file ( filePath ) ;
207
210
const fileUri = await convertClientPathToDebugger ( args . source . path , this . _namespace ) ;
208
211
const [ , fileName ] = fileUri . match ( / \| ( [ ^ | ] + ) $ / ) ;
209
212
@@ -225,9 +228,9 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
225
228
const line = breakpoint . line ;
226
229
if ( breakpoint . condition ) {
227
230
return new xdebug . ConditionalBreakpoint ( breakpoint . condition , fileUri , line ) ;
228
- } else if ( filePath . endsWith ( "cls" ) ) {
229
- return await vscode . workspace . openTextDocument ( filePath ) . then ( document => {
230
- const methodMatchPattern = new RegExp ( `^(?:Class)?Method (. +)(?=[( ])` , "i" ) ;
231
+ } else if ( fileName . endsWith ( "cls" ) ) {
232
+ return await vscode . workspace . openTextDocument ( uri ) . then ( document => {
233
+ const methodMatchPattern = new RegExp ( `^(?:Class)?Method ([^(] +)(?=[( ])` , "i" ) ;
231
234
for ( let i = line ; line > 0 ; i -- ) {
232
235
const lineOfCode = document . lineAt ( i ) . text ;
233
236
const methodMatch = lineOfCode . match ( methodMatchPattern ) ;
@@ -286,7 +289,8 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
286
289
stack . stack . map (
287
290
async ( stackFrame : xdebug . StackFrame , index ) : Promise < StackFrame > => {
288
291
const [ , namespace , name ] = decodeURI ( stackFrame . fileUri ) . match ( / ^ d b g p : \/ \/ \| ( [ ^ | ] + ) \| ( .* ) $ / ) ;
289
- const routine = name . includes ( "." ) ? name : name + ".int" ;
292
+ const routine = name ;
293
+ // const routine = name.includes(".") ? name : name + ".int";
290
294
const fileUri = DocumentContentProvider . getUri ( routine , null , namespace ) . toString ( ) ;
291
295
const source = new Source ( routine , fileUri ) ;
292
296
let line = stackFrame . line + 1 ;
0 commit comments