Skip to content

Commit 020cc10

Browse files
authored
correct workspace path for mutiroot scenarios no-config debugging (#602)
* correct workspace path for mutiroot scenarios no-config debugging * rename
1 parent 13bf88f commit 020cc10

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/extension/noConfigDebugInit.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ export async function registerNoConfigDebug(
3737

3838
// create a temp directory for the noConfigDebugAdapterEndpoints
3939
// file path format: extPath/.noConfigDebugAdapterEndpoints/endpoint-stableWorkspaceHash.txt
40-
const workspaceUri = workspace.workspaceFolders?.[0]?.uri;
41-
if (!workspaceUri) {
40+
let workspaceString = workspace.workspaceFile?.fsPath;
41+
if (!workspaceString) {
42+
workspaceString = workspace.workspaceFolders?.map((e) => e.uri.fsPath).join(';');
43+
}
44+
if (!workspaceString) {
4245
traceError('No workspace folder found');
4346
return Promise.resolve(new Disposable(() => {}));
4447
}
4548

4649
// create a stable hash for the workspace folder, reduce terminal variable churn
4750
const hash = crypto.createHash('sha256');
48-
hash.update(workspaceUri.toString());
51+
hash.update(workspaceString.toString());
4952
const stableWorkspaceHash = hash.digest('hex').slice(0, 16);
5053

5154
const tempDirPath = path.join(extPath, '.noConfigDebugAdapterEndpoints');

0 commit comments

Comments
 (0)