Skip to content

Conversation

@aiday-mar
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 23, 2025 18:59
@aiday-mar aiday-mar self-assigned this Dec 23, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds trace logging to track the state of PasteOptions.electronBugWorkaroundPasteEventHasFired, a boolean flag used to work around an Electron bug related to paste events. The logs are intended to help verify when this flag is set and what its value is during different stages of the paste operation.

Key Changes

  • Added trace logs in three locations where PasteOptions.electronBugWorkaroundPasteEventHasFired is set or checked
  • The logs output the variable name and its current value to aid in debugging paste-related issues

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.ts Added trace log in handlePaste method immediately after setting the flag to true
src/vs/editor/contrib/clipboard/browser/clipboard.ts Added two trace logs: one after setting the flag to false before triggering paste, and another inside the async callback to check if the flag changed
src/vs/editor/browser/controller/editContext/clipboardUtils.ts Added trace log in computePasteData function immediately after setting the flag to true


private async handlePaste(e: ClipboardEvent) {
PasteOptions.electronBugWorkaroundPasteEventHasFired = true;
this._logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired);
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log statement will always output true since it's placed immediately after the assignment. Consider removing this log or moving it to a location where the value might have changed, making the log more informative for debugging.

Suggested change
this._logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired);

Copilot uses AI. Check for mistakes.

logService.trace('registerExecCommandImpl (before triggerPaste)');
PasteOptions.electronBugWorkaroundPasteEventHasFired = false;
logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired);
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log statement will always output false since it's placed immediately after the assignment. Consider removing this log or moving it to a location where the value might have changed, making the log more informative for debugging.

Suggested change
logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired);

Copilot uses AI. Check for mistakes.
return;
}
PasteOptions.electronBugWorkaroundPasteEventHasFired = true;
logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired);
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log statement will always output true since it's placed immediately after the assignment. Consider removing this log or moving it to a location where the value might have changed, making the log more informative for debugging.

Suggested change
logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants