Skip to content

Commit

Permalink
build: Update telemetry wrapper to 0.14.0 (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo committed Jun 12, 2024
1 parent ffa87a3 commit 1d9db4f
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 51 deletions.
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand All @@ -32,12 +32,13 @@
"[java]": {
"editor.defaultFormatter": "redhat.java",
"editor.codeActionsOnSave": {
"source.fixAll.spotlessGradle": true
"source.fixAll.spotlessGradle": "explicit"
}
},
"[xml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
"files.trimTrailingWhitespace": true,
"java.compile.nullAnalysis.mode": "disabled"
}
144 changes: 107 additions & 37 deletions extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@
"minimatch": "^5.1.1",
"string-argv": "^0.3.1",
"tree-kill": "^1.2.2",
"vscode-extension-telemetry-wrapper": "0.13.3",
"vscode-extension-telemetry-wrapper": "0.14.0",
"vscode-languageclient": "7.0.0"
}
}
26 changes: 17 additions & 9 deletions extension/src/bs/BuildServerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,29 @@ export class BuildServerController implements Disposable {
this.logOutputChannel.appendLine(msg);
}
}),
commands.registerCommand(SEND_TELEMETRY_CMD, (data: string | object) => {
let jsonString: string;
commands.registerCommand(SEND_TELEMETRY_CMD, (data: string | object | Error) => {
let jsonObj: { [key: string]: any };

Check warning on line 63 in extension/src/bs/BuildServerController.ts

View workflow job for this annotation

GitHub Actions / Build & Analyse

Unexpected any. Specify a different type
if (typeof data === "string") {
jsonObj = JSON.parse(data);
jsonString = data;
} else {
jsonObj = data;
jsonString = JSON.stringify(data);
}
sendInfo("", {
kind: jsonObj.kind,
data: jsonString,
...(jsonObj.schemaVersion && { schemaVersion: jsonObj.schemaVersion }),
});

const { kind, trace, rootCauseMessage, schemaVersion, ...rest } = jsonObj;
if (trace || rootCauseMessage) {
sendInfo("", {
kind: "bsp-error",
operationName: jsonObj.operationName,
rootCauseMessage,
trace,
});
} else {
sendInfo("", {
kind: kind,
data2: JSON.stringify(rest),
...(schemaVersion && { schemaVersion: schemaVersion }),
});
}
}),
workspace.onDidChangeConfiguration((e: ConfigurationChangeEvent) => {
if (e.affectsConfiguration("java.gradle.buildServer.enabled")) {
Expand Down
2 changes: 1 addition & 1 deletion extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Extension } from "./Extension";
let extension: Extension;

export async function activate(context: vscode.ExtensionContext): Promise<Api> {
await initializeFromJsonFile(context.asAbsolutePath("./package.json"), { firstParty: true });
await initializeFromJsonFile(context.asAbsolutePath("./package.json"));
return instrumentOperation("activation", activateExtension)(context);
}

Expand Down

0 comments on commit 1d9db4f

Please sign in to comment.