Skip to content
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

Unexpected one line copy/paste behavior only in Java source code in VS Code #3445

Closed
yuma-fm opened this issue Dec 28, 2023 · 4 comments
Closed

Comments

@yuma-fm
Copy link

yuma-fm commented Dec 28, 2023

[provide a description of the issue]
With the Language Support for Java(TM) by Red Hat installed in VS Code, moving the cursor to any line of Java source code and copying the line with Ctrl + C and pasting it with Ctrl + V without selecting characters causes unintended behavior.

Environment
  • Operating System: Windows 11 Pro 23H2 22631.2861
  • JDK version: 17.0.3.7
  • Visual Studio Code version: 1.85.1
  • Java extension version: 1.25.1
Steps To Reproduce
  1. Start VS Code
  2. Install Language Support for Java(TM) by Red Hat
  3. Restart VS Code
  4. Open a file with any .java extension
  5. Copy and paste one line
Current Result

current

Expected Result

※ Behavior when uninstalling the Language Support for Java(TM) by Red Hat.
expect

Additional Informations

This text is written in Japanese and translated at DeepL.

@rgrunber
Copy link
Member

rgrunber commented Jan 4, 2024

As a workaround, could you try adding the following to either your workspace or user settings :

"[java]": {
        "editor.pasteAs.enabled": false
}

It should disable our paste support for the Java language only. If the problem no longer occurs, it's definitely related to vscode-java.

I'm not yet able to reproduce this so it could be a combination of either Windows 11 or the DeepL extension (assuming that's what you have ?) inserting additional characters. With that said, I think this might get solved by fixing #3444 . Our paste support should do nothing in cases where there's no interesting content to adjust.

@yuma-fm
Copy link
Author

yuma-fm commented Jan 9, 2024

thanks!!
By applying the above workaround, the problem is no longer reproduced. 🙇‍♂️

@fbricon
Copy link
Collaborator

fbricon commented Jan 11, 2024

While I can't reproduce the problem, the fix for #3444 surely also fixes this, as pasting no longer shows vscode-java involved, i.e. this pasting selector icon is no longer visible:
Screenshot 2024-01-11 at 09 04 25

@fbricon fbricon closed this as completed Jan 11, 2024
@fbricon fbricon added this to the Early January 2024 milestone Jan 11, 2024
@yuma-fm
Copy link
Author

yuma-fm commented Jan 11, 2024

After switching to version v1.26.2024011008 and removing the following options, this issue was not reproduced!

"[java]": {
    "editor.pasteAs.enabled": false
}

Thank you🙇‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants