2019-08-09 23:50:05 +00:00
|
|
|
import { registerSingleton } from "vs/platform/instantiation/common/extensions";
|
2019-08-03 00:26:41 +00:00
|
|
|
import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection";
|
2019-08-09 23:50:05 +00:00
|
|
|
import { ITelemetryService } from "vs/platform/telemetry/common/telemetry";
|
|
|
|
import { ILocalizationsService } from "vs/platform/localizations/common/localizations";
|
|
|
|
import { LocalizationsService } from "vs/platform/localizations/electron-browser/localizationsService";
|
|
|
|
import { IUpdateService } from "vs/platform/update/common/update";
|
|
|
|
import { UpdateService } from "vs/platform/update/electron-browser/updateService";
|
|
|
|
import { TelemetryChannelClient } from "vs/server/src/telemetry";
|
|
|
|
import { IRemoteAgentService } from "vs/workbench/services/remote/common/remoteAgentService";
|
2019-08-03 00:26:41 +00:00
|
|
|
|
2019-08-09 23:50:05 +00:00
|
|
|
class TelemetryService extends TelemetryChannelClient {
|
|
|
|
public constructor(
|
|
|
|
@IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
|
|
|
) {
|
|
|
|
super(remoteAgentService.getConnection()!.getChannel("telemetry"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
registerSingleton(ILocalizationsService, LocalizationsService);
|
|
|
|
registerSingleton(IUpdateService, UpdateService);
|
|
|
|
registerSingleton(ITelemetryService, TelemetryService);
|
|
|
|
|
|
|
|
import "vs/workbench/contrib/update/electron-browser/update.contribution";
|
2019-08-03 00:26:41 +00:00
|
|
|
|
2019-07-31 17:32:04 +00:00
|
|
|
import "vs/css!./media/firefox";
|
2019-08-09 23:50:05 +00:00
|
|
|
import { coderApi, vscodeApi } from "vs/server/src/api";
|
2019-07-31 17:32:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called by vs/workbench/browser/web.main.ts after the workbench has
|
|
|
|
* been initialized so we can initialize our own client-side code.
|
|
|
|
*/
|
2019-08-03 00:26:41 +00:00
|
|
|
export const initialize = async (services: ServiceCollection): Promise<void> => {
|
2019-07-31 17:32:04 +00:00
|
|
|
const target = window as any;
|
|
|
|
target.ide = coderApi(services);
|
|
|
|
target.vscode = vscodeApi(services);
|
|
|
|
|
2019-08-09 23:50:05 +00:00
|
|
|
const event = new CustomEvent("ide-ready");
|
2019-07-31 17:32:04 +00:00
|
|
|
(event as any).ide = target.ide;
|
|
|
|
(event as any).vscode = target.vscode;
|
|
|
|
window.dispatchEvent(event);
|
|
|
|
};
|