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

editor paste lags in response after large uptime #3936

Open
kraabrsg opened this issue Jan 29, 2025 · 3 comments
Open

editor paste lags in response after large uptime #3936

kraabrsg opened this issue Jan 29, 2025 · 3 comments

Comments

@kraabrsg
Copy link

Hi, sometimes after quite of time working on a maven quarkus project the pasting of text (e.g. from one file into another) takes a quite amount of time to finish.

In this example one string should be replaced by another string (the one which is selected)

Image

Image

The new string was visible after 4-5 seconds.

We are on the newest extension version 1.40 (happend also before).

JAVASE 21 for language Server, JAVASE 17 for the project (runtime). WIN 10.

Further settings in workspace:

    "java.import.gradle.enabled": false,
    "java.import.gradle.annotationProcessing.enabled": false,
    "java.configuration.detectJdksAtStart": false,
    "java.compile.nullAnalysis.mode": "automatic",
    "java.jdt.ls.androidSupport.enabled": "off",
    "java.jdt.ls.protobufSupport.enabled": false,

Is this from the eclipse language Server, or is this coming from this extension ?

Thank you!

@rgrunber rgrunber changed the title Lag of Languageserver editor paste lags in response after large uptime Feb 5, 2025
@rgrunber
Copy link
Member

rgrunber commented Feb 5, 2025

vscode-java has a custom paste event handler that can automatically escape the content of Strings that are pasted within "...", attempt to fill in missing imports from pasted code, as well as properly set up project structure when pasting a block of code.

As a workaround, you could disable the Java extension's custom paste support by setting :

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

Just to confirm. Does it always take 4-5 seconds when performing the exact same action, or only after working on the project for a long time. It would help if you set "java.trace.server": "verbose". This will generate quite a bit of logging so maybe not desired to have enabled at all times. When the problem happens again, I would open the command palette and select Java: Open Java Language Server Log File. Do you see any errors reported around the time of that 4-5s delay ? Also, if you just open the Output view, there should be a Language Support For Java entry from the dropdown (ignore the Syntax Server one). I'd be interested in any of the messages that sent a workspace/executeCommand request, with a command of java.edit.handlePasteEvent. There should be a response to that request and it would probably indicate how long the language server took to respond.

Otherwise, I am aware of some general odd behaviour the language server has where after running for some time, certain requests temporarily take longer, but often recover.

@kraabrsg
Copy link
Author

kraabrsg commented Feb 7, 2025

Hi @rgrunber thanks for getting back on this. I have set this setting and activated the trace. When i stumble upon this behaviour again (and i can provide more information) i will report here again...

@rgrunber
Copy link
Member

rgrunber commented Feb 7, 2025

Just be aware that

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

would be expected to make the issue completely go away as it disables our paste contribution. The other setting/instructions I mentioned are more to learn more about potentially where the slowdown happens when the above setting is not present (custom paste enabled).

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

2 participants