@@ -10,7 +10,7 @@ import {
1010} from "jsonc-parser" ;
1111import { VsCodeLaunch } from "./types/vsCodeConfig.js" ;
1212import { LldConfig } from "./types/lldConfig.js" ;
13- import { getModuleDirname } from "./getDirname.js" ;
13+ import { getModuleDirname , getProjectDirname } from "./getDirname.js" ;
1414import { Logger } from "./logger.js" ;
1515
1616async function getVsCodeLaunchConfig ( lldConfig ?: LldConfig ) {
@@ -54,9 +54,10 @@ async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
5454 }
5555 }
5656
57- if ( ! runtimeExecutableSet ) {
58- const globalModule1 = path . join ( moduleDirname , ".." , ".." , ".bin/lld" ) ;
59- const globalModule2 = path . join ( moduleDirname , ".." , ".." , "bin/lld" ) ;
57+ if ( runtimeExecutableSet ) {
58+ const projectDirname = getProjectDirname ( ) ;
59+ const globalModule1 = path . join ( projectDirname , ".." , ".." , ".bin/lld" ) ;
60+ const globalModule2 = path . join ( projectDirname , ".." , ".." , "bin/lld" ) ;
6061 const globalModule3 = path . join (
6162 moduleDirname ,
6263 ".." ,
@@ -165,7 +166,7 @@ async function getCurrentState(): Promise<
165166 filePath : string ;
166167 }
167168> {
168- const filePath = path . join ( path . resolve ( ) , ".vscode/launch.json" ) ;
169+ const filePath = path . join ( getProjectDirname ( ) , ".vscode/launch.json" ) ;
169170
170171 let createNewFile = false ;
171172
0 commit comments