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

[Bug]: Garbled / misplaced auto-completion text while typing #3490

Closed
yunkot opened this issue Oct 9, 2024 · 3 comments
Closed

[Bug]: Garbled / misplaced auto-completion text while typing #3490

yunkot opened this issue Oct 9, 2024 · 3 comments
Assignees
Labels

Comments

@yunkot
Copy link

yunkot commented Oct 9, 2024

What happened?

I'm using CodeLite built from revision 84dd6dd. Running on Linux Mint 22 (based on Ubuntu 24.04 LTS) / XFCE desktop running on Xorg / wxWidgets 3.2.4, on CPU Ryzen 9 5950X, 128Gb RAM. I'm working with C++ source code using clangd LSP.

Previously, I've been using CodeLite revision 6eb52aa, so roughly 9-10 months ago. I see that there are some new features, which is nice.

However, now I'm experiencing issues with code completion. Here are my steps:

  1. Type a long function name, for instance, we are trying to write "interpolateWaypointPosition()".
  2. After a couple of characters, e.g. "interp", a code completion popup appears showing the necessary function name. Press Enter to auto-complete it.
  3. Immediately after pressing "Enter", continue typing "()" to finish function call.

Expected: you end up with "interpolateWaypointPosition()" written.
Actual: you end up with "interp()interpolateWaypointPosition" written.

The occurrence of the issue is sporadic and seems to be dependent on auto-completion speed. Sometimes after you press "Enter", the response is immediate and issue does not occur, but sometimes CodeLite "lags" a bit, around 200-500ms or so while completing the word, which is slow enough for you to continue typing, which results in the aforementioned issue.

The problem did not happen in older version of CodeLite I was using/ I suspect that in new version, auto-completion is executed asynchronously, which produces the issue due to "racing" condition with your keyboard input.

Version

Commit 84dd6dd

Operating system

Linux Mint 22 / XFCE / Xorg / wxWidgets 3.2.4

@yunkot yunkot added the bug label Oct 9, 2024
@yunkot
Copy link
Author

yunkot commented Oct 10, 2024

This issue is quite difficult to reproduce when OS is more responsive - on Linux Mint 21 / Ubuntu 22.04 / Debian 12, I practically can't reproduce it because OS is much more responsive, so code completion seems to be always instant. Newer Linux Mint 22 and Ubuntu 24.04 seem to be more sluggish on my hardware configuration, so this issue is more pronounced.

The OS "sluggishness" is another topic, but this issue is quite a showstopper. I'm offering a bounty of 75 USD for a fix as an incentive. Alternatively (or additionally), if you would consider #3494, I'd be the first to add support.

eranif added a commit that referenced this issue Oct 19, 2024
Signed-off-by: Eran Ifrah <[email protected]>
@eranif
Copy link
Owner

eranif commented Oct 19, 2024

This is probably because of this line:

wxCodeCompletionBoxManager::Get().CallAfter(&wxCodeCompletionBoxManager::InsertSelection, match, true);

Which basically performs the insertion on the next event loop, you can try and pull CodeLite from master and see if this fixes the issue.

@yunkot
Copy link
Author

yunkot commented Oct 19, 2024

I'm using build from commit cd24547 and can no longer reproduce this. In fact, code completion seems to be slightly more responsive now. Therefore, I think the issue is fixed. Many thanks!

P.S. I've send the bounty as donation. Please consider request #3494 on opening a sponsors page.

@yunkot yunkot closed this as completed Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants