Skip to content

Commit 2af6fe8

Browse files
authored
Disable commit-characters for all code completion. (#358)
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
1 parent 9f69fc8 commit 2af6fe8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/clangd-context.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ export class ClangdContext implements vscode.Disposable {
115115
new vscode.Range((item.range as vscode.Range).start, position))
116116
if (prefix)
117117
item.filterText = prefix + '_' + item.filterText;
118+
// Workaround for https://github.com/clangd/vscode-clangd/issues/357
119+
// clangd's used of commit-characters was well-intentioned, but
120+
// overall UX is poor. Due to vscode-languageclient bugs, we didn't
121+
// notice until the behavior was in several releases, so we need
122+
// to override it on the client.
123+
item.commitCharacters = [];
118124
return item;
119125
})
120126
return new vscode.CompletionList(items, /*isIncomplete=*/ true);

0 commit comments

Comments
 (0)