From 0c38ca07f3297b4828a7ee5d0127c096e12d9a02 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 8 Jan 2026 11:24:52 +0100 Subject: [PATCH] Revert "Add logging for early returns in copy and paste handling (#282989)" This reverts commit 39b0686add631ce4880bb93d0c1a38b257141342. --- .../dropOrPasteInto/browser/copyPasteController.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts b/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts index 273b539a988..3d524982981 100644 --- a/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts +++ b/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts @@ -182,7 +182,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi this._logService.trace('CopyPasteController#handleCopy'); } if (!this._editor.hasTextFocus()) { - this._logService.trace('CopyPasteController#handleCopy/earlyReturn1'); return; } @@ -192,14 +191,12 @@ export class CopyPasteController extends Disposable implements IEditorContributi this._clipboardService.clearInternalState?.(); if (!e.clipboardData || !this.isPasteAsEnabled()) { - this._logService.trace('CopyPasteController#handleCopy/earlyReturn2'); return; } const model = this._editor.getModel(); const selections = this._editor.getSelections(); if (!model || !selections?.length) { - this._logService.trace('CopyPasteController#handleCopy/earlyReturn3'); return; } @@ -209,7 +206,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty(); if (wasFromEmptySelection) { if (!enableEmptySelectionClipboard) { - this._logService.trace('CopyPasteController#handleCopy/earlyReturn4'); return; } @@ -230,7 +226,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi .filter(x => !!x.prepareDocumentPaste); if (!providers.length) { this.setCopyMetadata(e.clipboardData, { defaultPastePayload }); - this._logService.trace('CopyPasteController#handleCopy/earlyReturn5'); return; } @@ -259,7 +254,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi CopyPasteController._currentCopyOperation?.operations.forEach(entry => entry.operation.cancel()); CopyPasteController._currentCopyOperation = { handle, operations }; - this._logService.trace('CopyPasteController#handleCopy/end'); } private async handlePaste(e: ClipboardEvent) { @@ -271,7 +265,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi this._logService.trace('CopyPasteController#handlePaste'); } if (!e.clipboardData || !this._editor.hasTextFocus()) { - this._logService.trace('CopyPasteController#handlePaste/earlyReturn1'); return; } @@ -282,7 +275,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi const model = this._editor.getModel(); const selections = this._editor.getSelections(); if (!selections?.length || !model) { - this._logService.trace('CopyPasteController#handlePaste/earlyReturn2'); return; } @@ -290,7 +282,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi this._editor.getOption(EditorOption.readOnly) // Never enabled if editor is readonly. || (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested) ) { - this._logService.trace('CopyPasteController#handlePaste/earlyReturn3'); return; } @@ -333,7 +324,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi e.preventDefault(); e.stopImmediatePropagation(); } - this._logService.trace('CopyPasteController#handlePaste/earlyReturn4'); return; } @@ -348,7 +338,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi } else { this.doPasteInline(allProviders, selections, dataTransfer, metadata, e); } - this._logService.trace('CopyPasteController#handlePaste/end'); } private showPasteAsNoEditMessage(selections: readonly Selection[], preference: PastePreference) {