File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import * as os from "os" ;
22import * as vscode from 'vscode' ;
3+ import * as path from 'path' ;
34import * as ra from './rust-analyzer-api' ;
45
56import { Cargo } from './cargo' ;
@@ -72,15 +73,24 @@ export async function getDebugConfiguration(ctx: Ctx, config: ra.Runnable): Prom
7273 debugOutput . show ( true ) ;
7374 }
7475
76+ const wsFolder = path . normalize ( vscode . workspace . workspaceFolders ! [ 0 ] . uri . fsPath ) ; // folder exists or RA is not active.
77+ function simplifyPath ( p : string ) : string {
78+ return path . normalize ( p ) . replace ( wsFolder , '${workspaceRoot}' ) ;
79+ }
80+
7581 const executable = await getDebugExecutable ( config ) ;
76- const debugConfig = knownEngines [ debugEngine . id ] ( config , executable , debugOptions . sourceFileMap ) ;
82+ const debugConfig = knownEngines [ debugEngine . id ] ( config , simplifyPath ( executable ) , debugOptions . sourceFileMap ) ;
7783 if ( debugConfig . type in debugOptions . engineSettings ) {
7884 const settingsMap = ( debugOptions . engineSettings as any ) [ debugConfig . type ] ;
7985 for ( var key in settingsMap ) {
8086 debugConfig [ key ] = settingsMap [ key ] ;
8187 }
8288 }
8389
90+ if ( debugConfig . cwd ) {
91+ debugConfig . cwd = simplifyPath ( debugConfig . cwd ) ;
92+ }
93+
8494 return debugConfig ;
8595}
8696
You can’t perform that action at this time.
0 commit comments