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

Pass the projects manager to the telemetry manager in a safer manner. #2856

Merged
merged 1 commit into from
Sep 20, 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
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public IStatus runInWorkspace(IProgressMonitor monitor) {
projectsManager.configureFilters(monitor);
JavaLanguageServerPlugin.logInfo("Workspace initialized in " + (System.currentTimeMillis() - start) + "ms");
connection.sendStatus(ServiceStatus.Started, "Ready");
telemetryManager.onProjectsInitialized(projectsManager, System.currentTimeMillis());
telemetryManager.onProjectsInitialized(System.currentTimeMillis());
} catch (OperationCanceledException e) {
connection.sendStatus(ServiceStatus.Error, "Initialization has been cancelled.");
return Status.CANCEL_STATUS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ public void connectClient(JavaLanguageClient client) {
this.workspaceEventHandler = new WorkspaceEventsHandler(pm, this.client, this.documentLifeCycleHandler);
this.telemetryManager.setLanguageClient(client);
this.telemetryManager.setPreferenceManager(preferenceManager);
this.telemetryManager.setProjectseManager(pm);
}

// For testing purpose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ public void setPreferenceManager(PreferenceManager prefs) {
this.prefs = prefs;
}

public void setProjectseManager(ProjectsManager projectsManager) {
this.projectsManager = projectsManager;
}

public void onLanguageServerStart(long timeMillis, boolean firstTimeInitialization) {
this.languageServerStartTime = timeMillis;
this.firstTimeInitialization = firstTimeInitialization;
}

public void onProjectsInitialized(ProjectsManager projectsManager, long timeMillis) {
this.projectsManager = projectsManager;
public void onProjectsInitialized(long timeMillis) {
this.projectsInitializedTime = timeMillis;
}

Expand Down Expand Up @@ -133,7 +136,7 @@ public void onBuildFinished(long buildFinishedTime) {
} catch (CoreException e) {
// ignore
}

}
}
}
Expand Down