Skip to content

Setting rust-analyzer.onEnter breaks code completion #11432

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

Closed
CleanCut opened this issue Feb 8, 2022 · 3 comments · Fixed by #11433
Closed

Setting rust-analyzer.onEnter breaks code completion #11432

CleanCut opened this issue Feb 8, 2022 · 3 comments · Fixed by #11433

Comments

@CleanCut
Copy link

CleanCut commented Feb 8, 2022

rust-analyzer version: rust-analyzer version: 0add6e95e 2021-12-20 stable

rustc version: rustc 1.58.1 (db9d1b20b 2022-01-20)

Several months ago VS Code stopped reliably doing code completion on my high-end Mac hardware. At first it was subtle, but in recent months my code completion has basically been broken, unless I slowly. type. one. letter. at. a. time. Resuming normal typing speed at any time mostly results in no code completion at all, though occasionally something shows up.

Then I chanced upon this reddit thread and tried removing this from my keybindings.json:

    {
        "key": "Enter",
        "command": "rust-analyzer.onEnter",
        "when": "editorTextFocus && !suggestWidgetVisible && editorLangId == rust"
    }

and EVERYTHING WORKS AGAIN!!!

I've had that setting in my config since I switched to VS Code somewhere between 1.5 and 2.5 years ago (or maybe it was when the feature was introduced and I saw it in a changelog? ...my memory is so fuzzy...), and I'll miss the feature--but I want code completion more. Until recent months, everything worked fine. I don't know what's up, but it'd be nice to at least put a warning on that setting, if it can't be fixed anyway.

@lnicola
Copy link
Member

lnicola commented Feb 8, 2022

Well, there's a reason why it's disabled by default. I'll add a warning to the docs. By the way, we now also have some regex-based heuristics for comment continuation. Hmm, did that break?

Do you have other extensions installed? What if you disable them and re-enable onEnter?

@jhgg
Copy link
Contributor

jhgg commented Feb 8, 2022

I slowly. type. one. letter. at. a. time.

This... seems unrelated to the keybind. I'm not even sure how this would break autocomplete.

@CleanCut
Copy link
Author

Bleh. After more testing, it's apparent that removing this setting didn't fix the problem. 😞 Sorry for the noise.

bors bot added a commit that referenced this issue Feb 28, 2022
11433: minor: Add scary warning to `onEnter` r=lnicola a=lnicola

Closes #11432

Co-authored-by: Laurențiu Nicola <[email protected]>
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

Successfully merging a pull request may close this issue.

3 participants