microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
297 stars 132 forks source link

Test Runner extension breaks "clipboardPasteAction" in Java files #1689

Closed bevzzz closed 7 months ago

bevzzz commented 7 months ago

When enabled, the VSCode extension prevents text from being pasted.
Here's a relevant excerpt from Keyboard Shortcuts Troubleshooting log:

2024-05-02 11:59:15.724 [info] [KeybindingService]: / Received  keydown event - modifiers: [meta], code: KeyV, keyCode: 86, key: v
2024-05-02 11:59:15.724 [info] [KeybindingService]: | Converted keydown event - modifiers: [meta], code: KeyV, keyCode: 52 ('V')
2024-05-02 11:59:15.725 [info] [KeybindingService]: | Resolving meta+[KeyV]
2024-05-02 11:59:15.725 [info] [KeybindingService]: \ From 5 keybinding entries, matched editor.action.clipboardPasteAction, when: no when condition, source: built-in.
2024-05-02 11:59:15.725 [info] [KeybindingService]: + Invoking command editor.action.clipboardPasteAction.
2024-05-02 11:59:15.730 [error] Cannot read properties of undefined (reading 'isCancellationRequested'): TypeError: Cannot read properties of undefined (reading 'isCancellationRequested')
    at d.<anonymous> (/Users/d.solovei/.vscode/extensions/redhat.java-1.30.0-darwin-x64/dist/extension.js:2:967366)
    at Generator.next (<anonymous>)
    at o (/Users/d.solovei/.vscode/extensions/redhat.java-1.30.0-darwin-x64/dist/extension.js:2:966443)

Interestingly, the error message above mentions rendhat.java extension, but it is the disabling of "Test Runner" that fixes the issue.

VSCode version info

Version: 1.80.2 (Universal) Commit: 2ccd690cbff1569e4a83d7c43d45101f817401dc Date: 2023-07-27T21:05:41.366Z (9 mos ago) Electron: 22.3.14 ElectronBuildId: 22695494 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Darwin x64 23.3.0

Operating System

macOS Sonoma 14.3.1

Extension version info

v0.40.1

Published: 12/1/2017, 12:44:10 Last released: 4/25/2024, 18:46:00 Last updated: 5/2/2024, 11:58:37 Identifier: vscjava.vscode-java-test

Steps to reproduce

  1. Install "Test Runner For Java"
  2. Open a .java file (other files, e.g. yaml are fine)
  3. Copy and paste any amount of text (doesn't matter if with a shortcut or with mouse actions)

Once the extension is disabled, copy-paste works as usual.

bevzzz commented 7 months ago

After a couple more rounds of switching different extensions back and forth, I realized it was indeed the RedHat's extension causing the issue, just like the logs said. I opened a ticket in their repo instead and am closing this one.