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

Disable commit-characters for all code completion. #358

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

sam-mccall
Copy link
Member

The use of commit-characters in clangd had good intentions, but it has
terrible UX in practice in VSCode, as documented on the linked bug.

We didn't notice this until it was far too late: the commit characters
were added in clangd 12, but bugs in vscode-languageclient prevented
them from being noticed until languageclient-8.
(microsoft/vscode-languageserver-node#673)

At this point we can't go back and change the server behavior so we need
to override it on the client.

Fixes #357

The use of commit-characters in clangd had good intentions, but it has
terrible UX in practice in VSCode, as documented on the linked bug.

We didn't notice this until it was far too late: the commit characters
were added in clangd 12, but bugs in vscode-languageclient prevented
them from being noticed until languageclient-8.
(microsoft/vscode-languageserver-node#673)

At this point we can't go back and change the server behavior so we need
to override it on the client.

Fixes clangd#357
@sam-mccall
Copy link
Member Author

Locally verified that reapplying eb61c51 leads to the bad behavior reported in the bug, and then applying this patch reverts to the old code completion behavior.

sam-mccall added a commit to llvm/llvm-project that referenced this pull request Jul 12, 2022
This was added in 2a095ff, however it never worked with VSCode
due to bugs in vscode-languageclient
(microsoft/vscode-languageserver-node#673).
Now that it does work, we can tell the interactions with text editing, with
snippets, and vscode's select-first-completion behavior are bad.

The spec is vague and clients could do something reasonable with the
current values. However they could clearly do something unreasonable
too, and over time behavior+spec tends to converge on VSCode's behavior.

This addresses clangd/vscode-clangd#358
See also clangd/vscode-clangd#358 which hotfixes
this on the client-side (as we can't apply this change retroactively to
clangd 12-14).

Differential Revision: https://reviews.llvm.org/D129579
@sam-mccall sam-mccall merged commit 2af6fe8 into clangd:master Jul 12, 2022
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this pull request Oct 7, 2022
This was added in 2a095ff6f5028b76, however it never worked with VSCode
due to bugs in vscode-languageclient
(microsoft/vscode-languageserver-node#673).
Now that it does work, we can tell the interactions with text editing, with
snippets, and vscode's select-first-completion behavior are bad.

The spec is vague and clients could do something reasonable with the
current values. However they could clearly do something unreasonable
too, and over time behavior+spec tends to converge on VSCode's behavior.

This addresses clangd/vscode-clangd#358
See also clangd/vscode-clangd#358 which hotfixes
this on the client-side (as we can't apply this change retroactively to
clangd 12-14).

Differential Revision: https://reviews.llvm.org/D129579
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 this pull request may close these issues.

Automatically selecting auto completion suggestion despite not pressing enter or tab key
2 participants