unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72765: Eglot + Clangd + Company + non-empty suffix = duplicate text
@ 2024-08-22 23:07 Dmitry Gutov
  2024-08-29 11:34 ` Eli Zaretskii
  0 siblings, 1 reply; 18+ messages in thread
From: Dmitry Gutov @ 2024-08-22 23:07 UTC (permalink / raw)
  To: 72765

Here's an example I came upon when testing:


test.c
```
int foo_bar_1;
int foo_bar_2;

int main() {foo_bar|456

```

Point is at |.

If you use completion-at-point, *Completions* buffer pops up, you choose 
one of the options with M-down and M-RET, "_1" is inserted. Good.

But if you use Company, type "_" (or backspace and re-add "r") - a popup 
comes up with "foo_bar_1" and "foo_bar_2", you choose one of the 
options, and the text becomes "foo_bar_1456456", suffix is duplicated.

This only happens with Clang, out of the servers I've tested.

You need a fairly recent Company to reproduce (from master), the 
previous versions simply didn't support completion in the middle of a 
symbol.

To add something that completion-at-point trips over, though: when 
"foo_bar_2" (existing var name) is already inserted, move point to the 
middle of it and press C-M-i:

```
   foo_|bar_2
```

will turn to

```
   foo_bar_2bar_2|
```





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-09-10 13:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 23:07 bug#72765: Eglot + Clangd + Company + non-empty suffix = duplicate text Dmitry Gutov
2024-08-29 11:34 ` Eli Zaretskii
2024-08-30 21:23   ` Dmitry Gutov
2024-08-31  6:47     ` Eli Zaretskii
2024-08-31 12:03       ` João Távora
2024-09-01  1:43         ` Dmitry Gutov
2024-09-01  9:43           ` João Távora
2024-09-01 14:28             ` Dmitry Gutov
2024-09-03 13:20               ` Dmitry Gutov
2024-09-03 13:43                 ` João Távora
2024-09-08  2:41                   ` Dmitry Gutov
2024-09-08 15:51                     ` João Távora
2024-09-09  0:20                       ` Dmitry Gutov
2024-09-09 11:46                         ` Eli Zaretskii
2024-09-10  0:58                           ` Dmitry Gutov
2024-09-10 11:47                             ` Eli Zaretskii
2024-09-10 13:20                               ` Dmitry Gutov
2024-09-10  1:40                       ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).