Skip to content

Commit

Permalink
Report errors of type dtree.ObjectNotFoundException as 'java.ls.error'.
Browse files Browse the repository at this point in the history
- Report language server errors relating to
  'org.eclipse.core.internal.dtree.ObjectNotFoundException',
  coming from 'telemetry/event' as 'java.ls.error'.

Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed Feb 26, 2024
1 parent d004bda commit db77113
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions USAGE_DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vscode-java has opt-in telemetry collection, provided by [vscode-redhat-telemetr
* The total size (in bytes) of libraries that were indexed after project initialization
* The number of error markers on the project(s)
* The number of unresolved imports within the project(s)
* Errors relating to running the language server, such as the message & stacktrace
* Whether there is a mismatch between the project's requested source level, and the JDK used for the project (eg. true)
* Information about the following settings. In the case of settings that store a well defined value (eg. path/url/string), we simply collect whether the setting has been set.
* `java.settings.url`, `java.format.settings.url`, `java.quickfix.showAt`, `java.symbols.includeSourceMethodDeclarations`, `java.completion.collapseCompletionItems`, `java.completion.guessMethodArguments`, `java.completion.postfix.enabled`, `java.cleanup.actionsOnSave`, `java.sharedIndexes.enabled`, `java.inlayHints.parameterNames.enabled`, `java.server.launchMode`, `java.autobuild.enabled`
Expand Down
5 changes: 5 additions & 0 deletions src/standardLanguageClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ export class StandardLanguageClient {
apiManager.fireTraceEvent(e);
if (e.name === Telemetry.SERVER_INITIALIZED_EVT) {
return Telemetry.sendTelemetry(Telemetry.STARTUP_EVT, e.properties);
} else if (e.name === Telemetry.LS_ERROR) {
const exception: string = e?.properties.exception;
if (exception !== undefined && exception.includes("dtree.ObjectNotFoundException")) {
return Telemetry.sendTelemetry(Telemetry.LS_ERROR, e.properties);
}
}
});

Expand Down
1 change: 1 addition & 0 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export namespace Telemetry {
export const STARTUP_EVT = "startup";
export const COMPLETION_EVENT = "textCompletion";
export const SERVER_INITIALIZED_EVT = "java.workspace.initialized";
export const LS_ERROR = "java.ls.error";
let telemetryManager: TelemetryService = null;
let serverInitializedReceived = false;

Expand Down

0 comments on commit db77113

Please sign in to comment.