Skip to content

Commit 1912f86

Browse files
committed
Update the message asking for tracing consent
1 parent 803843c commit 1912f86

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

vscode-dotty/src/tracer.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ export class Tracer {
8888

8989
private askForTracingConsent(): void {
9090
vscode.window.showInformationMessage(
91-
'Do you want to help EPFL develop Dotty LSP plugin by uploading your LSP communication? ' +
92-
'PLEASE BE AWARE that the data sent contains your entire codebase and ALL the IDE actions, ' +
93-
'including every single keystroke.',
94-
'yes', 'no'
91+
'To help us improve the Scala IDE support, we would like to collect ' +
92+
'the content of every Scala file in your project and ' +
93+
'every interaction with Scala files in the IDE, including keystrokes. ' +
94+
'This data will be stored anonymously (we won\'t know your name) on servers at EPFL in Switzerland.',
95+
'Allow', 'Deny',
9596
).then((value: string | undefined) => {
96-
if (value === 'yes' || value === 'no') this.tracingConsent.set(value)
97+
if (value === 'Allow' || value === 'Deny') this.tracingConsent.set(value)
9798
})
9899
}
99100

@@ -109,7 +110,7 @@ export class Tracer {
109110
}
110111
}
111112

112-
if (this.tracingConsent.get() === 'yes') {
113+
if (this.tracingConsent.get() === 'Allow') {
113114
doInitialize()
114115
} else {
115116
let didInitialize = false
@@ -127,14 +128,15 @@ export class Tracer {
127128
item.command = consentCommandName
128129
const renderStatusBarItem = () => {
129130
item.text = (() => {
130-
const desc = this.tracingConsent.get() === 'yes' ? 'ON' : 'OFF'
131-
return `$(radio-tower) Dotty trace: ${desc}`
131+
const desc = this.tracingConsent.get() === 'Allow' ? 'On' : 'Off'
132+
return `$(radio-tower) Scala telemetry: ${desc}`
132133
})()
133134

134135
item.tooltip = (() => {
135-
const desc = this.tracingConsent.get() === 'yes' ? 'consented' : 'not consented'
136-
return `This workspace is configured for remote tracing of Dotty LSP and you have ${desc} to it. ` +
137-
'Click to adjust your consent.'
136+
const desc = this.tracingConsent.get() === 'Allow' ? 'enabled' : 'disabled'
137+
const toggle = this.tracingConsent.get() === 'Allow' ? 'disable' : 'enable'
138+
return `Data collection for Scala is ${desc}. ` +
139+
`Click to ${toggle} it.`
138140
})()
139141
}
140142
renderStatusBarItem()
@@ -284,20 +286,20 @@ export class Tracer {
284286

285287
append: (value: string) => {
286288
localOutputChannel.append(value)
287-
if (this.tracingConsent.get() === 'no') return
289+
if (this.tracingConsent.get() === 'Deny') return
288290
log += value
289291
},
290292

291293
appendLine: (value: string) => {
292294
localOutputChannel.appendLine(value)
293-
if (this.tracingConsent.get() === 'no') {
295+
if (this.tracingConsent.get() === 'Deny') {
294296
log = ''
295297
return
296298
}
297299

298300
log += value
299301
log += '\n'
300-
if (this.tracingConsent.get() === 'yes') withSocket((socket) => {
302+
if (this.tracingConsent.get() === 'Allow') withSocket((socket) => {
301303
if (socket.readyState === WebSocket.OPEN) {
302304
const send = (msg: string) => socket.send(msg, (err) => {
303305
if (err) {

vscode-dotty/src/tracing-consent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Memento } from 'vscode'
22

3-
export type TracingConsent = 'yes' | 'no' | 'no-answer'
3+
export type TracingConsent = 'Allow' | 'Deny' | 'no-answer'
44

55
export class TracingConsentCache {
66
private readonly workspaceState: Memento
@@ -17,13 +17,13 @@ export class TracingConsentCache {
1717
if (this.cache !== undefined) return this.cache
1818
const setting = this.workspaceState.get('remote-tracing-consent')
1919
this.cache = setting === undefined ? 'no-answer'
20-
: setting ? 'yes'
21-
: 'no'
20+
: setting ? 'Allow'
21+
: 'Deny'
2222
return this.cache
2323
}
2424

25-
set(value: 'yes' | 'no'): void {
26-
this.workspaceState.update('remote-tracing-consent', value === 'yes')
25+
set(value: 'Allow' | 'Deny'): void {
26+
this.workspaceState.update('remote-tracing-consent', value === 'Allow')
2727
this.cache = value
2828
this.subscribers.forEach(f => f())
2929
}

0 commit comments

Comments
 (0)