This commit is contained in:
2025-11-02 19:17:20 +08:00
parent ebf784146e
commit e71b69db5f
2575 changed files with 1242294 additions and 95 deletions

View File

@@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
import { ITelemetryService } from '../../telemetry/common/telemetry.js';
import { IDataChannelService } from '../common/dataChannel.js';
export class InterceptingTelemetryService {
constructor(_baseService, _intercept) {
this._baseService = _baseService;
this._intercept = _intercept;
}
publicLog2(eventName, data) {
this._intercept(eventName, data);
this._baseService.publicLog2(eventName, data);
}
}
let DataChannelForwardingTelemetryService = class DataChannelForwardingTelemetryService extends InterceptingTelemetryService {
constructor(telemetryService, dataChannelService) {
super(telemetryService, (eventName, data) => {
// filter for extension
let forward = true;
if (data && shouldForwardToChannel in data) {
forward = Boolean(data[shouldForwardToChannel]);
}
if (forward) {
dataChannelService.getDataChannel('editTelemetry').sendData({ eventName, data: data });
}
});
}
};
DataChannelForwardingTelemetryService = __decorate([
__param(0, ITelemetryService),
__param(1, IDataChannelService)
], DataChannelForwardingTelemetryService);
export { DataChannelForwardingTelemetryService };
const shouldForwardToChannel = Symbol('shouldForwardToChannel');
export function forwardToChannelIf(value) {
return {
// This will not be sent via telemetry, it is just a marker
[shouldForwardToChannel]: value
};
}
export function isCopilotLikeExtension(extensionId) {
if (!extensionId) {
return false;
}
const extIdLowerCase = extensionId.toLowerCase();
return extIdLowerCase === 'github.copilot' || extIdLowerCase === 'github.copilot-chat';
}
//# sourceMappingURL=forwardingTelemetryService.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
import { createDecorator } from '../../instantiation/common/instantiation.js';
export const IDataChannelService = createDecorator('dataChannelService');
export class NullDataChannelService {
getDataChannel(_channelId) {
return {
sendData: () => { },
};
}
}
//# sourceMappingURL=dataChannel.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/platform/dataChannel/common/dataChannel.ts","vs/platform/dataChannel/common/dataChannel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAsB,oBAAoB,CAAC,CAAC;AAY9F,MAAM,OAAO,sBAAsB;IAElC,cAAc,CAAI,UAAkB;QACnC,OAAO;YACN,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC;SACnB,CAAC;IACH,CAAC;CACD","file":"dataChannel.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\n\nexport const IDataChannelService = createDecorator<IDataChannelService>('dataChannelService');\n\nexport interface IDataChannelService {\n\treadonly _serviceBrand: undefined;\n\n\tgetDataChannel<T>(channelId: string): CoreDataChannel<T>;\n}\n\nexport interface CoreDataChannel<T = unknown> {\n\tsendData(data: T): void;\n}\n\nexport class NullDataChannelService implements IDataChannelService {\n\t_serviceBrand: undefined;\n\tgetDataChannel<T>(_channelId: string): CoreDataChannel<T> {\n\t\treturn {\n\t\t\tsendData: () => { },\n\t\t};\n\t}\n}\n","\nimport { createDecorator } from '../../instantiation/common/instantiation.js';\n\nexport const IDataChannelService = createDecorator<IDataChannelService>('dataChannelService');\n\nexport interface IDataChannelService {\n\treadonly _serviceBrand: undefined;\n\n\tgetDataChannel<T>(channelId: string): CoreDataChannel<T>;\n}\n\nexport interface CoreDataChannel<T = unknown> {\n\tsendData(data: T): void;\n}\n\nexport class NullDataChannelService implements IDataChannelService {\n\t_serviceBrand: undefined;\n\tgetDataChannel<T>(_channelId: string): CoreDataChannel<T> {\n\t\treturn {\n\t\t\tsendData: () => { },\n\t\t};\n\t}\n}\n"]}