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

Suggestions often inserted in incorrect place #4851

Closed
Elias-Graf opened this issue Nov 22, 2022 · 8 comments
Closed

Suggestions often inserted in incorrect place #4851

Elias-Graf opened this issue Nov 22, 2022 · 8 comments
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@Elias-Graf
Copy link

Elias-Graf commented Nov 22, 2022

Summary

Suggestions are often inserted into the incorrect place. This does occur more frequently when the computer itself is not the quickest (e.g. happens more often on my laptop than on my desktop), and is way more frequent on larger code bases.

See this video that shows the issue in action:

Screen.Recording.2022-11-22.at.12.11.46.mov

Notice how I'm trying to complete after I typed "expe", but the completions seem to be "old". So it then seems to use old position information and just inserts it before the "p", leaving me with "expectp". Same thing happens with "e" ("expecte") in a different try after that.

Btw. the project in question is in React / TypeScript.

Sometimes this leaves me with up to three redundant characters on a completion "attempt" (which I use extensively), so it's not rare that I need to correct four different things on a single line.

Reproduction Steps

Sadly, there is no clear-cut reproduction I can provide. But it feels like a race condition to me?

Helix log

As far as I'm able to tell, there is no log produced during the entirety of the issue.

Platform

macOs

Terminal Emulator

iTerm 2

Helix Version

helix-term 22.08.1 (5ad3bef)

@Elias-Graf Elias-Graf added the C-bug Category: This is a bug label Nov 22, 2022
@Elias-Graf
Copy link
Author

Here is the same thing in the helix codebase:

Untitled.mov

It was significantly harder to reproduce than on the React / TypeScript codebase.

@archseer
Copy link
Member

Can you check if this PR fixes it for you? #1819

@Elias-Graf
Copy link
Author

@archseer Hey, how would I properly test this? I tried merging it into current master which lead to merge conflicts. That pull request is currently 428 commits behind. The bug could have been introduced in one of those. Do you have any prior commit you would want me to try to confirm that the issue existed before the fix?

@archseer
Copy link
Member

I'm pretty sure the issue is with the LSP response being slow and extra characters being typed before it comes back and has always been there. That PR is specifically supposed to address that.

@David-Else
Copy link
Contributor

@archseer #1819 needs to be rebased to master for people to test, @Elias-Graf was saying there are merge conflicts.

There seems to be problems with the pull request reported too... I have been hit by this serious bug using Rust #4380, it would be great to get it sorted for 22.11, maybe add it to the 22.11 milestone ?

@Elias-Graf
Copy link
Author

Elias-Graf commented Nov 22, 2022

@archseer I'm going to test tomorrow with the fixed but old version. For the like 15 mins I have been using it today, it seemed like that issue was gone (although I couldn't always autocomplete, since the sorting of the items seemed worse). If this fixes the issue, I would really appreciate if it could be merged quickly, as it's actively preventing me from programming, and I've switched back to VS Code for languages where the language server is apparently slower than my typing.

@kirawi kirawi added the A-language-server Area: Language server client label Nov 22, 2022
@Elias-Graf
Copy link
Author

Elias-Graf commented Nov 23, 2022

@archseer I have been using it a few hours now, and haven't experienced the issue since.

I can't be 100% sure, because some things are obviously outdated in this rather old commit (see: #4851 (comment)).

@cossonleo maybe you could look into bringing the bugfix back in line with master?

@archseer
Copy link
Member

archseer commented Mar 9, 2023

Should be fixed by #6173

@archseer archseer closed this as completed Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants