-
Notifications
You must be signed in to change notification settings - Fork 37k
adding logs to verify booleans #284884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
adding logs to verify booleans #284884
Conversation
There was a problem hiding this 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.electronBugWorkaroundPasteEventHasFiredis 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); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
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.
| this._logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired); |
|
|
||
| logService.trace('registerExecCommandImpl (before triggerPaste)'); | ||
| PasteOptions.electronBugWorkaroundPasteEventHasFired = false; | ||
| logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
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.
| logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired); |
| return; | ||
| } | ||
| PasteOptions.electronBugWorkaroundPasteEventHasFired = true; | ||
| logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired); |
Copilot
AI
Dec 23, 2025
There was a problem hiding this comment.
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.
| logService.trace('PasteOptions.electronBugWorkaroundPasteEventHasFired : ', PasteOptions.electronBugWorkaroundPasteEventHasFired); |
No description provided.