Skip to content

Commit 8b54306

Browse files
committed
vscode-dotty: fix anonymity of tracing
1 parent e42f452 commit 8b54306

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

vscode-dotty/src/tracer.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,16 @@ export class Tracer {
6969
return persisted(uuidv4())
7070
})()
7171

72-
this.projectId = vscode.workspace.name !== undefined ? vscode.workspace.name : 'no-project'
72+
if (vscode.workspace.name !== undefined) {
73+
// HACK: The projects cloned by students use the naming convention
74+
// `$id-$name-$githubUsername`, so they leak the student's github
75+
// username, to preserve anonymity, we drop the last part of the
76+
// name.
77+
this.projectId = vscode.workspace.name.replace(/^(\d+-.+)-.+$/, "$1")
78+
} else {
79+
this.projectId = 'no-project'
80+
}
81+
7382
this.sessionId = new Date().toISOString()
7483
}
7584

0 commit comments

Comments
 (0)