Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/extension/noConfigDebugInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ export async function registerNoConfigDebug(

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

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

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