fix(lsp): prevent duplicate trailing punctuation in clangd #2003
+13
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Strip the trailing angle bracket or quote from clangd file completion items to avoid duplicated characters.
This issue is a side effect of the recent change in
compensate_for_cursor_movement
(hope this is the only one). Clangd deliberately includes the closing punctuation in all "file" completion candidates. This behavior is opinionated and there is currently no way to opt out (see clangd/clangd#2277).While it bothers me to add this downstream workaround, I believe it is reasonable to let users handle the closing character themselves—either manually or via a pairs plugin as they do when using the "path" source or from other lsp.
Feel free to close this PR if you think there is a better solution.
Closes #1989