From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#72705: 31.0.50; eglot--dumb-tryc Filters out too much Date: Mon, 19 Aug 2024 14:39:13 +0300 Message-ID: <54dacc71-4395-431f-abc4-c60dc070cb03@gutov.dev> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32253"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 72705@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 19 13:40:38 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 1sg0kX-0008GQ-AY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Aug 2024 13:40:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sg0kH-0002by-PY; Mon, 19 Aug 2024 07:40:21 -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 1sg0kG-0002bW-Ec for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 07:40:20 -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 1sg0kG-000138-4j for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 07:40:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=Le2GZo1TtkmF0xgsPLhgeaFn3Z6fNCPleBufyg6vUVw=; b=lA7Z23xqI5hvS6LN5ITDNYA7dfuDWU5CvOfJl/fKwZoLok64q0jyJc+azGYsysRF/jPJ2KbKTxpSrfXNmr42ssiqm4AR7AqsCT8YQko/NOxQNnP95deGp0v2/oJroOm3yxP4mB3HCKLa/RT0iLKidnbCLtWUd/QfWvTtb9ZM9uBrHdqO3SGsN0WciQUN3zgiwAA5G4Qsl6r0PIUbxqutGUeW5aRHiQ2X5yInwNBc0Mno9z2LxGMbXM4tckS73zzAccS+1R9WtwC+u7cruefrsFQRA093MXAKLZoVgJ2jUf4Wy1TAkzXqelooMGBh794pZQstzQIVyNIpgfq7xpoC/g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sg0kv-00016s-Ju for bug-gnu-emacs@gnu.org; Mon, 19 Aug 2024 07:41:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2024 11:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72705 X-GNU-PR-Package: emacs Original-Received: via spool by 72705-submit@debbugs.gnu.org id=B72705.17240676074180 (code B ref 72705); Mon, 19 Aug 2024 11:41:01 +0000 Original-Received: (at 72705) by debbugs.gnu.org; 19 Aug 2024 11:40:07 +0000 Original-Received: from localhost ([127.0.0.1]:57779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg0k3-00015M-5F for submit@debbugs.gnu.org; Mon, 19 Aug 2024 07:40:07 -0400 Original-Received: from fout5-smtp.messagingengine.com ([103.168.172.148]:55575) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg0k0-00014V-Mr for 72705@debbugs.gnu.org; Mon, 19 Aug 2024 07:40:05 -0400 Original-Received: from phl-compute-07.internal (phl-compute-07.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id 7552E138FFFE; Mon, 19 Aug 2024 07:39:17 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Mon, 19 Aug 2024 07:39:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1724067557; x=1724153957; bh=Le2GZo1TtkmF0xgsPLhgeaFn3Z6fNCPleBufyg6vUVw=; b= oWXjcrIVPl6T/49ZAk7bLKlRDFAusmgBw+TRtNRkkr4tDbAYqQ0Q4xnPfCOFmIQN Xh5/E7thg3emuxFsfP/8dPRmfYsxY3i8VyYPP91Y5bea3GT0e2TEmML5kX1Lr2Fb ZVevCg+UTYS/aiYskZQIdhzqIIijORaaS0f5UkyLAdZUAHklvVvYovaLQCyDE5eY hJZpP1Ud4Dxnyzfa7ibEK86Pzi2OBY8HP3Z9mSqqePykgelf4xEmHQcgmGd063m5 u2hWu1fhDGvK+CR09B6WUS8gLWlle6+HWx1FW/kGIfsO35SIhuJRAVyGLgLst2oo 5+b7nrXWm/+SuToRjgkF+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1724067557; x= 1724153957; bh=Le2GZo1TtkmF0xgsPLhgeaFn3Z6fNCPleBufyg6vUVw=; b=j gj4api9W4LwyhegSIV/eV0LVzbsGPoV2ERtE/KcZ95wO5FXJDDD+7geteRUgs7IV h6yV+69jDYxS+npBITnKgFvdMooeCwS1xilcjtvsuOYBFOc5Xi04KrJYdrq3o43L gxbRPWW3IVeB4YJDdRwFce9gmFMjMY6B/zoL2i8Jq/x72jtQgkVyvIrV3+ReLDEt Q09hZKGH/mk2OSXhZ0wxQOFPWLfpoJFALko/vHLQc5hu8vYNvLa8qu5bcISsTJkV Q3EAbs23U09QCdLYbcwrcCTjNVfGyBQXdobQZ3BxQOEYd1iBAHWC/yRDRirUQYDk 8LtlYSmz4loEjAl2Yg7kA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddugedggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveeg tedthefhudekteehffeukeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho pedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjohgrohhtrghvohhrrgesgh hmrghilhdrtghomhdprhgtphhtthhopeejvdejtdehseguvggssghughhsrdhgnhhurdho rhhg X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Aug 2024 07:39:15 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:290385 Archived-At: On 19/08/2024 12:22, João Távora wrote: > On Mon, Aug 19, 2024 at 2:52 AM Dmitry Gutov wrote: > >> has more completions >> (one can look at them by pressing TAB after "math.A") > > That's not relevant. LSP servers can make completely different > decisions in each position. What's relevant is to look at the completion > list returned in the "math.As" case (via the events buffer, for example). True, but it's hard to look at completions for "math.As" using completion-at-point because try-completion behaves this way. You can also check out Company's completions popup for "math.As" - it shows the extra ones. >> Not sure what's the best fix, but the patch below seems to address both >> problems in my limited testing. WDYT? > > I would be (pleasantly) surprised if your change doesn't break something > else. I tried many many variations in the fairly recent past and each > of them seemed to break something. Be wary of :exit-function > which is where things like snippet conversion and edits happen. > So I'd say this need more testing, especially with more servers. Here's hoping. > I also don't understand why the "string-prefix" is being used. > The "dumb" in eglot--dumb-try should be taken to heart. string-prefix-p is being used because 'try-completion' will ignore non-prefix completions as if they weren't there. We need to make sure that the proposed "probe" is indeed a prefix for all completions. > See logs of commits: > d376462c7183752bf44b9bd20bf5020fe7eaf75a > 4dcbf61c1518dc53061707aeff8887517e050003 > a6ef458e3831001b0acad57cf8fa75b77a4aff3f > > You should also encode whatever decisions you make in > tests in eglot-tests.el. Thanks for the references, I'll dig in more. Surprised to hear that exit-function can be affected.