From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72765: Eglot + Clangd + Company + non-empty suffix = duplicate text Date: Thu, 29 Aug 2024 14:34:10 +0300 Message-ID: <86o75bftql.fsf@gnu.org> References: <83e5b9c4-0f5f-49c4-a4b2-fe553c59b2f6@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8142"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72765@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 29 13:35:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sjdQr-0001u3-EG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Aug 2024 13:35:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sjdQj-0002f2-4L; Thu, 29 Aug 2024 07:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sjdQh-0002ec-1x for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2024 07:35:07 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sjdQg-0003Ia-MZ for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2024 07:35:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=uD00I+2NHzXzp8J1O/OQxypmGEDOY6nIFKihTQY85Aw=; b=MlYDvCPrD6k1WvOp7u7LBbpv78utR+KOBskwtOfz14xxo3ADAQP/shAxjubBvdFMwfieRqmFRqcR8ncXaS6WrVmjYQWL5KOEgU01F1mCbyBkRpm6GXF25dQ+VI29u+nvenlFU+BGfZMePQNBtnRBfPJZ5EWuHb/kOy5NN2FoHPTDsIsBuTr9ha2RSYp2/FRupPBAvwD8G5KQOP0khDVgrYyoF2k08cxwsYEXFxErr5mUsFhhie4BPL63AnXygHqKk+zV2x8ArnSiKT3bpZQjHOmqbtBbqfNoK3sq42NzvWU/WC8dcvFg5LyfSYUlhvH2tNCLrt/iH5o1wTUy7HXiuA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sjdRZ-0004IM-TB for bug-gnu-emacs@gnu.org; Thu, 29 Aug 2024 07:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Aug 2024 11:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72765 X-GNU-PR-Package: emacs Original-Received: via spool by 72765-submit@debbugs.gnu.org id=B72765.172493132516441 (code B ref 72765); Thu, 29 Aug 2024 11:36:01 +0000 Original-Received: (at 72765) by debbugs.gnu.org; 29 Aug 2024 11:35:25 +0000 Original-Received: from localhost ([127.0.0.1]:50600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sjdQy-0004H7-Rz for submit@debbugs.gnu.org; Thu, 29 Aug 2024 07:35:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sjdQx-0004Gt-7L for 72765@debbugs.gnu.org; Thu, 29 Aug 2024 07:35:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sjdPy-00035I-IB; Thu, 29 Aug 2024 07:34:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=uD00I+2NHzXzp8J1O/OQxypmGEDOY6nIFKihTQY85Aw=; b=nF1W791u5e2y h3crWSH/Jm00fzjrGO5Ua7tc0RufDR6avzQeiOoIzkCV4Uaj8LWO1UmdaGYjEe9DTJ87nE1PYlA94 ujhOqptJL57VAJQA2LXXihOWeZpEfYAlZmDcOqotsv8CLneMNK/Y+FCzN8N3P0jGfNn/4ITYWYfFB 24uSsQi+7gFjXLPG9vA4Kj+Yr2Vm/BjXfpnD6FjeNVq/366bQ+GiZMbZW71X9MlWIgx7wM+mAsILY S/ZKIJmOJ6hKJoA+OBTogKbULDT+oRGg7JR6EIzz5GAS4K2da7kDWt2oNIGZYNGrDWQYKHN+LfuBu 5aM6R7gir6/TlSNeAHee2w==; In-Reply-To: <83e5b9c4-0f5f-49c4-a4b2-fe553c59b2f6@gutov.dev> (message from Dmitry Gutov on Fri, 23 Aug 2024 02:07:59 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290922 Archived-At: > Date: Fri, 23 Aug 2024 02:07:59 +0300 > From: Dmitry Gutov > > 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| > ``` Is this an Eglot problem or a completion-at-point problem?