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 1
1
import * as os from "os" ;
2
2
import * as vscode from 'vscode' ;
3
+ import * as path from 'path' ;
3
4
import * as ra from './rust-analyzer-api' ;
4
5
5
6
import { Cargo } from './cargo' ;
@@ -72,15 +73,24 @@ export async function getDebugConfiguration(ctx: Ctx, config: ra.Runnable): Prom
72
73
debugOutput . show ( true ) ;
73
74
}
74
75
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
+
75
81
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 ) ;
77
83
if ( debugConfig . type in debugOptions . engineSettings ) {
78
84
const settingsMap = ( debugOptions . engineSettings as any ) [ debugConfig . type ] ;
79
85
for ( var key in settingsMap ) {
80
86
debugConfig [ key ] = settingsMap [ key ] ;
81
87
}
82
88
}
83
89
90
+ if ( debugConfig . cwd ) {
91
+ debugConfig . cwd = simplifyPath ( debugConfig . cwd ) ;
92
+ }
93
+
84
94
return debugConfig ;
85
95
}
86
96
You can’t perform that action at this time.
0 commit comments