• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / vscode-brightscript-language / #2719

24 Aug 2022 12:51PM UTC coverage: 41.691% (+0.02%) from 41.675%
#2719

push

TwitchBronBron
2.35.0

477 of 1427 branches covered (33.43%)

Branch coverage included in aggregate %.

1126 of 2418 relevant lines covered (46.57%)

7.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.0
/src/managers/TelemetryManager.ts
1
import TelemetryReporter from '@vscode/extension-telemetry';
1✔
2
import type { Disposable } from 'vscode';
3
import type { BrightScriptLaunchConfiguration } from '../DebugConfigurationProvider';
4
import type { RemoteControlModeInitiator } from './RemoteControlManager';
5

6
const APP_INSIGHTS_KEY = '8618f206-4732-4729-88ed-d07dcf17f199';
1✔
7

8
export class TelemetryManager implements Disposable {
1✔
9
    public constructor(
10
        public options: {
7✔
11
            extensionId: string;
12
            extensionVersion: string;
13
            applicationInsightsKey?: string;
14
        }
15
    ) {
16
        this.reporter = new TelemetryReporter(this.options.extensionId, this.options.extensionVersion, this.options.applicationInsightsKey ?? APP_INSIGHTS_KEY);
7!
17
    }
18

19
    public dispose() {
20
        return this.reporter.dispose();
×
21
    }
22

23
    /**
24
     * The extension has first started up
25
     */
26
    public sendStartupEvent() {
27
        this.reporter.sendTelemetryEvent('startup');
7✔
28
    }
29

30
    /**
31
     * Track when a debug session has been started
32
     */
33
    public sendStartDebugSessionEvent(event: BrightScriptLaunchConfiguration & { preLaunchTask: string }) {
34
        this.reporter.sendTelemetryEvent('startDebugSession', {
×
35
            enableDebugProtocol: boolToString(event.enableDebugProtocol),
36
            retainDeploymentArchive: boolToString(event.retainDeploymentArchive),
37
            retainStagingFolder: boolToString(event.retainStagingFolder),
38
            injectRaleTrackerTask: boolToString(event.injectRaleTrackerTask),
39
            isFilesDefined: isDefined(event.files),
40
            isPreLaunchTaskDefined: isDefined(event.preLaunchTask),
41
            isComponentLibrariesDefined: isDefined(event.componentLibraries),
42
            isDeepLinkUrlDefined: isDefined(event.deepLinkUrl),
43
            isStagingFolderPathDefined: isDefined(event.stagingFolderPath)
44
        });
45
    }
46

47
    /**
48
     * Track when remoteControlMode has been enabled or disabled (we don't track WHAT users send, only that they're enabling/disabling the feature)
49
     * @param enabled is the remoteControlMode being enabled or disabled
50
     * @param initiator who triggered this event. 'statusbar' is when the user clicks the "toggle remote mode" in the statusbar.
51
     *                  "command" is when it's triggered directly from a vscode command
52
     */
53
    public sendSetRemoteControlModeEvent(isEnabled: boolean, initiator: RemoteControlModeInitiator) {
54
        this.reporter.sendTelemetryEvent('setRemoteControlMode', {
×
55
            isEnabled: boolToString(isEnabled),
56
            initiator: initiator
57
        });
58
    }
59

60
    private reporter: TelemetryReporter;
61
}
62

63
function boolToString(value: boolean | undefined) {
64
    return value?.toString() ?? 'undefined';
×
65
}
66

67
function isDefined(value: any) {
68
    return value ? 'true' : 'false';
×
69
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc