Skip to content

Commit c4d41c9

Browse files
committed
Revert "Add logging for early returns in copy and paste handling (microsoft#282989)"
This reverts commit 39b0686.
1 parent b8793eb commit c4d41c9

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
182182
this._logService.trace('CopyPasteController#handleCopy');
183183
}
184184
if (!this._editor.hasTextFocus()) {
185-
this._logService.trace('CopyPasteController#handleCopy/earlyReturn1');
186185
return;
187186
}
188187

@@ -192,14 +191,12 @@ export class CopyPasteController extends Disposable implements IEditorContributi
192191
this._clipboardService.clearInternalState?.();
193192

194193
if (!e.clipboardData || !this.isPasteAsEnabled()) {
195-
this._logService.trace('CopyPasteController#handleCopy/earlyReturn2');
196194
return;
197195
}
198196

199197
const model = this._editor.getModel();
200198
const selections = this._editor.getSelections();
201199
if (!model || !selections?.length) {
202-
this._logService.trace('CopyPasteController#handleCopy/earlyReturn3');
203200
return;
204201
}
205202

@@ -209,7 +206,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
209206
const wasFromEmptySelection = selections.length === 1 && selections[0].isEmpty();
210207
if (wasFromEmptySelection) {
211208
if (!enableEmptySelectionClipboard) {
212-
this._logService.trace('CopyPasteController#handleCopy/earlyReturn4');
213209
return;
214210
}
215211

@@ -230,7 +226,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
230226
.filter(x => !!x.prepareDocumentPaste);
231227
if (!providers.length) {
232228
this.setCopyMetadata(e.clipboardData, { defaultPastePayload });
233-
this._logService.trace('CopyPasteController#handleCopy/earlyReturn5');
234229
return;
235230
}
236231

@@ -259,7 +254,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
259254

260255
CopyPasteController._currentCopyOperation?.operations.forEach(entry => entry.operation.cancel());
261256
CopyPasteController._currentCopyOperation = { handle, operations };
262-
this._logService.trace('CopyPasteController#handleCopy/end');
263257
}
264258

265259
private async handlePaste(e: ClipboardEvent) {
@@ -271,7 +265,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
271265
this._logService.trace('CopyPasteController#handlePaste');
272266
}
273267
if (!e.clipboardData || !this._editor.hasTextFocus()) {
274-
this._logService.trace('CopyPasteController#handlePaste/earlyReturn1');
275268
return;
276269
}
277270

@@ -282,15 +275,13 @@ export class CopyPasteController extends Disposable implements IEditorContributi
282275
const model = this._editor.getModel();
283276
const selections = this._editor.getSelections();
284277
if (!selections?.length || !model) {
285-
this._logService.trace('CopyPasteController#handlePaste/earlyReturn2');
286278
return;
287279
}
288280

289281
if (
290282
this._editor.getOption(EditorOption.readOnly) // Never enabled if editor is readonly.
291283
|| (!this.isPasteAsEnabled() && !this._pasteAsActionContext) // Or feature disabled (but still enable if paste was explicitly requested)
292284
) {
293-
this._logService.trace('CopyPasteController#handlePaste/earlyReturn3');
294285
return;
295286
}
296287

@@ -333,7 +324,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
333324
e.preventDefault();
334325
e.stopImmediatePropagation();
335326
}
336-
this._logService.trace('CopyPasteController#handlePaste/earlyReturn4');
337327
return;
338328
}
339329

@@ -348,7 +338,6 @@ export class CopyPasteController extends Disposable implements IEditorContributi
348338
} else {
349339
this.doPasteInline(allProviders, selections, dataTransfer, metadata, e);
350340
}
351-
this._logService.trace('CopyPasteController#handlePaste/end');
352341
}
353342

354343
private showPasteAsNoEditMessage(selections: readonly Selection[], preference: PastePreference) {

0 commit comments

Comments
 (0)