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

Slow editing performance on cdt-lsp and visual glitches in editor, especially inlay hints #391

Open
voertler opened this issue Dec 20, 2024 · 6 comments

Comments

@voertler
Copy link

On eclipse cdt 2024-12 I get bad editing performance for files in the text editor, this leads to inlay hints disappearing randomly, slow code highlighting, and even parenthesis outside the inlay hints disapparing. Also the cursor is flickering, which can take several seconds to go back to normal. Also the outline selection flickers.
inlayperformance

When disabling inlay hints in cdt the behaviour is slightly better but also refresh problems occur as can be seen on the fold markers.
grafik

Using VSCode with the same clangd server I cannot see similar issues.

When this appears an exception is thrown, which might be related:
java.util.concurrent.CompletionException: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request cancelled because the document was modified
at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:323)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:376)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:391)
at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:752)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:554)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2238)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:220)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:204)
at org.eclipse.lsp4e.LanguageServerWrapper.lambda$3(LanguageServerWrapper.java:314)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:185)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:97)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:114)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: org.eclipse.lsp4j.jsonrpc.ResponseErrorException: Request cancelled because the document was modified
... 11 more

@ghentschke
Copy link
Contributor

Thanks for the report. Do you noticed this behavior in previous Eclipse releases as well?

@ghentschke
Copy link
Contributor

Do you have many includes in your file?

@ghentschke
Copy link
Contributor

Which clangd version are you using?

@ghentschke
Copy link
Contributor

Which version of cdt-lsp and lsp4e are you using?

@voertler
Copy link
Author

voertler commented Dec 23, 2024

@ghentschke Thanks for your reply

  • I'm under windows and tried both the download version of eclipse-cpp-2024-12 and eclipse-cpp-2024-09. Plugins are:
    grafik
  • Disabled windows defender
  • clangd version is 17, but this version works fine in VisualStudio Code
  • The source file has not a lot of includes and is actually the only file in the compile_commands.json, here is the example attached:
    cdt_lsp_slow.zip

It rather seems that something is blocking the display thread, as cursor blinking is also very unregular after moving it by using cursor keys. Also highlighting of same occurences (e.g. function names) can take over 5s after moving around the cursor. During this time it seems that the display thread tries to catch up with a lot of display events leading to graphics bugs. The old non-lsp editor has not this behavior in the same eclipse version.

@voertler
Copy link
Author

Now I also checked the Linux version using wsl. There performance is a bit better, however I can also trigger the slow update of inlay hints.
inlayperformancelinux

  • Rocky 8 under WSL
  • Plugins for eclipse-cpp-2024-12
    grafik

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

No branches or pull requests

2 participants