Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track debug server event #1357

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license.

export const JAVA_LANGID: string = "java";
export const TELEMETRY_EVENT = "telemetry";
export const HCR_EVENT = "hotcodereplace";
export const USER_NOTIFICATION_EVENT = "usernotification";

Expand Down
11 changes: 8 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import * as _ from "lodash";
import * as path from "path";
import * as vscode from "vscode";
import { dispose as disposeTelemetryWrapper, initializeFromJsonFile, instrumentOperation,
instrumentOperationAsVsCodeCommand, setUserError } from "vscode-extension-telemetry-wrapper";
instrumentOperationAsVsCodeCommand, sendInfo, setUserError } from "vscode-extension-telemetry-wrapper";
import * as commands from "./commands";
import { JavaDebugConfigurationProvider, lastUsedLaunchConfig } from "./configurationProvider";
import { HCR_EVENT, JAVA_LANGID, USER_NOTIFICATION_EVENT } from "./constants";
import { HCR_EVENT, JAVA_LANGID, TELEMETRY_EVENT, USER_NOTIFICATION_EVENT } from "./constants";
import { NotificationBar } from "./customWidget";
import { initializeCodeLensProvider, startDebugging } from "./debugCodeLensProvider";
import { initExpService } from "./experimentationService";
Expand Down Expand Up @@ -120,7 +120,12 @@ function registerDebugEventListener(context: vscode.ExtensionContext) {
if (t !== JAVA_LANGID) {
return;
}
if (customEvent.event === HCR_EVENT) {
if (customEvent.event === TELEMETRY_EVENT) {
sendInfo("", {
operationName: customEvent.body?.name,
...customEvent.body?.properties,
});
} else if (customEvent.event === HCR_EVENT) {
handleHotCodeReplaceCustomEvent(customEvent);
} else if (customEvent.event === USER_NOTIFICATION_EVENT) {
handleUserNotification(customEvent);
Expand Down