Skip to content

Commit

Permalink
Remove no longer needed logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Feb 21, 2025
1 parent d21e43e commit a8e09c1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 64 deletions.
20 changes: 2 additions & 18 deletions src/vs/workbench/api/browser/mainThreadWebviewPanels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import { URI } from '../../../base/common/uri.js';
import { generateUuid } from '../../../base/common/uuid.js';
import { IConfigurationService } from '../../../platform/configuration/common/configuration.js';
import { IStorageService } from '../../../platform/storage/common/storage.js';
import { ITelemetryService } from '../../../platform/telemetry/common/telemetry.js';
import { MainThreadWebviews, reviveWebviewContentOptions, reviveWebviewExtension } from './mainThreadWebviews.js';
import * as extHostProtocol from '../common/extHost.protocol.js';
import { DiffEditorInput } from '../../common/editor/diffEditorInput.js';
import { EditorInput } from '../../common/editor/editorInput.js';
import { ExtensionKeyedWebviewOriginStore, WebviewOptions } from '../../contrib/webview/browser/webview.js';
Expand All @@ -24,6 +21,8 @@ import { GroupLocation, GroupsOrder, IEditorGroup, IEditorGroupsService, preferr
import { ACTIVE_GROUP, IEditorService, PreferredGroup, SIDE_GROUP } from '../../services/editor/common/editorService.js';
import { IExtensionService } from '../../services/extensions/common/extensions.js';
import { IExtHostContext } from '../../services/extensions/common/extHostCustomers.js';
import * as extHostProtocol from '../common/extHost.protocol.js';
import { MainThreadWebviews, reviveWebviewContentOptions, reviveWebviewExtension } from './mainThreadWebviews.js';

/**
* Bi-directional map between webview handles and inputs.
Expand Down Expand Up @@ -98,7 +97,6 @@ export class MainThreadWebviewPanels extends Disposable implements extHostProtoc
@IEditorService private readonly _editorService: IEditorService,
@IExtensionService extensionService: IExtensionService,
@IStorageService storageService: IStorageService,
@ITelemetryService private readonly _telemetryService: ITelemetryService,
@IWebviewWorkbenchService private readonly _webviewWorkbenchService: IWebviewWorkbenchService,
) {
super();
Expand Down Expand Up @@ -174,20 +172,6 @@ export class MainThreadWebviewPanels extends Disposable implements extHostProtoc
}, this.webviewPanelViewType.fromExternal(viewType), initData.title, mainThreadShowOptions);

this.addWebviewInput(handle, webview, { serializeBuffersForPostMessage: initData.serializeBuffersForPostMessage });

const payload = {
extensionId: extension.id.value,
viewType
} as const;

type Classification = {
extensionId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Id of the extension that created the webview panel' };
viewType: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Id of the webview' };
owner: 'mjbvz';
comment: 'Triggered when a webview is created. Records the type of webview and the extension which created it';
};

this._telemetryService.publicLog2<typeof payload, Classification>('webviews:createWebviewPanel', payload);
}

public $disposeWebview(handle: extHostProtocol.WebviewHandle): void {
Expand Down
28 changes: 0 additions & 28 deletions src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import * as dom from '../../../../base/browser/dom.js';
import { StandardMouseEvent } from '../../../../base/browser/mouseEvent.js';
import { getDefaultHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegateFactory.js';
import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';
import { Lazy } from '../../../../base/common/lazy.js';
import { Disposable } from '../../../../base/common/lifecycle.js';
import { URI } from '../../../../base/common/uri.js';
import { generateUuid } from '../../../../base/common/uuid.js';
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
import { IRange } from '../../../../editor/common/core/range.js';
import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js';
Expand Down Expand Up @@ -92,8 +90,6 @@ export class InlineAnchorWidget extends Disposable {
const contextKeyService = this._register(originalContextKeyService.createScoped(element));
this._chatResourceContext = chatAttachmentResourceContextKey.bindTo(contextKeyService);

const anchorId = new Lazy(generateUuid);

element.classList.add(InlineAnchorWidget.className, 'show-file-icons');

let iconText: string;
Expand All @@ -109,18 +105,6 @@ export class InlineAnchorWidget extends Disposable {
iconText = this.data.symbol.name;
iconClasses = ['codicon', ...getIconClasses(modelService, languageService, undefined, undefined, SymbolKinds.toIcon(symbol.kind))];

this._register(dom.addDisposableListener(element, 'click', () => {
telemetryService.publicLog2<{
anchorId: string;
}, {
anchorId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for the current anchor.' };
owner: 'mjbvz';
comment: 'Provides insight into the usage of Chat features.';
}>('chat.inlineAnchor.openSymbol', {
anchorId: anchorId.value
});
}));

this._store.add(instantiationService.invokeFunction(accessor => hookUpSymbolAttachmentDragAndContextMenu(accessor, element, contextKeyService, { value: symbol.location, name: symbol.name, kind: symbol.kind }, MenuId.ChatInlineSymbolAnchorContext)));
} else {
location = this.data;
Expand Down Expand Up @@ -148,18 +132,6 @@ export class InlineAnchorWidget extends Disposable {
})
.catch(() => { });

this._register(dom.addDisposableListener(element, 'click', () => {
telemetryService.publicLog2<{
anchorId: string;
}, {
anchorId: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Unique identifier for the current anchor.' };
owner: 'mjbvz';
comment: 'Provides insight into the usage of Chat features.';
}>('chat.inlineAnchor.openResource', {
anchorId: anchorId.value
});
}));

// Context menu
this._register(dom.addDisposableListener(element, dom.EventType.CONTEXT_MENU, async domEvent => {
const event = new StandardMouseEvent(dom.getWindow(domEvent), domEvent);
Expand Down
22 changes: 4 additions & 18 deletions src/vs/workbench/contrib/webview/browser/webviewElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import { isFirefox } from '../../../../base/browser/browser.js';
import { addDisposableListener, EventType, getWindowById } from '../../../../base/browser/dom.js';
import { parentOriginHash } from '../../../../base/browser/iframe.js';
import { IMouseWheelEvent } from '../../../../base/browser/mouseEvent.js';
import { CodeWindow } from '../../../../base/browser/window.js';
import { promiseWithResolvers, ThrottledDelayer } from '../../../../base/common/async.js';
import { streamToBuffer, VSBufferReadableStream } from '../../../../base/common/buffer.js';
import { CancellationTokenSource } from '../../../../base/common/cancellation.js';
Expand All @@ -26,18 +28,15 @@ import { IInstantiationService } from '../../../../platform/instantiation/common
import { ILogService } from '../../../../platform/log/common/log.js';
import { INotificationService } from '../../../../platform/notification/common/notification.js';
import { IRemoteAuthorityResolverService } from '../../../../platform/remote/common/remoteAuthorityResolver.js';
import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';
import { ITunnelService } from '../../../../platform/tunnel/common/tunnel.js';
import { WebviewPortMappingManager } from '../../../../platform/webview/common/webviewPortMapping.js';
import { parentOriginHash } from '../../../../base/browser/iframe.js';
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js';
import { decodeAuthority, webviewGenericCspSource, webviewRootResourceAuthority } from '../common/webview.js';
import { loadLocalResource, WebviewResourceResponse } from './resourceLoading.js';
import { WebviewThemeDataProvider } from './themeing.js';
import { areWebviewContentOptionsEqual, IWebview, WebviewContentOptions, WebviewExtensionDescription, WebviewInitInfo, WebviewMessageReceivedEvent, WebviewOptions } from './webview.js';
import { WebviewFindDelegate, WebviewFindWidget } from './webviewFindWidget.js';
import { FromWebviewMessage, KeyEvent, ToWebviewMessage, WebViewDragEvent } from './webviewMessages.js';
import { decodeAuthority, webviewGenericCspSource, webviewRootResourceAuthority } from '../common/webview.js';
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js';
import { CodeWindow } from '../../../../base/browser/window.js';

interface WebviewContent {
readonly html: string;
Expand Down Expand Up @@ -158,7 +157,6 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD
@IFileService private readonly _fileService: IFileService,
@ILogService private readonly _logService: ILogService,
@IRemoteAuthorityResolverService private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService,
@ITelemetryService private readonly _telemetryService: ITelemetryService,
@ITunnelService private readonly _tunnelService: ITunnelService,
@IInstantiationService instantiationService: IInstantiationService,
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,
Expand Down Expand Up @@ -588,18 +586,6 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD
if (this._environmentService.isExtensionDevelopment) {
this._onMissingCsp.fire(this.extension.id);
}

const payload = {
extension: this.extension.id.value
} as const;

type Classification = {
extension: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The id of the extension that created the webview.' };
owner: 'mjbz';
comment: 'Helps find which extensions are contributing webviews with invalid CSPs';
};

this._telemetryService.publicLog2<typeof payload, Classification>('webviewMissingCsp', payload);
}
}

Expand Down

0 comments on commit a8e09c1

Please sign in to comment.