From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: master 08c80c45dde: Don't use file-truepath in Eglot (bug#70036) Date: Thu, 18 Apr 2024 11:57:31 +0200 Message-ID: <878r1bro1g.fsf@thornhill.no> References: <171215083924.12380.5369373861551158668@vcs2.savannah.gnu.org> <20240403132719.A18EFC12C28@vcs2.savannah.gnu.org> <87il0fsufu.fsf@thornhill.no> <86o7a7fcf4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1706"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 18 11:58:11 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rxOWw-0000Dm-Eb for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Apr 2024 11:58:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxOWa-00074N-BK; Thu, 18 Apr 2024 05:57:48 -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 1rxOWT-000734-Ot for emacs-devel@gnu.org; Thu, 18 Apr 2024 05:57:45 -0400 Original-Received: from out-189.mta1.migadu.com ([2001:41d0:203:375::bd]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxOWR-0001mN-3B for emacs-devel@gnu.org; Thu, 18 Apr 2024 05:57:41 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1713434256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ey92FRinnDtjbRMv3OtFm1qnEEuBpMxmiXQQKCyL3k0=; b=fcvAu2g2lGwa6vQthaysXm/ADiQqylUx7oGNN+dLZDyV4QL7QOsNXwl3nvdTUokkYXpieu SvX4zs3urgql0h8Hm+MB+LNgzGld5EC6Zhb6fW8Sx/n0JprV9+QJByMKO2v//v7TXm2lpG ftRFebg5BKEeZ8R843X8eW0SvsUrxwtJFxbpv43HTgoMhk36SYeDJG21dDq0JJHYxzvdBD DDciu27Pjqb/aqcW1GqrGjDVnnM/lUzhMu+Qq4Gt7353bjDnwgb54vc7C4SmeQNVdRVqG9 K5L2Bai9PziEgqBJecPkIGgepNLyk0rVHX3sC7kV+D2p6nM0d0/goAWEZ15bGg== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::bd; envelope-from=theo@thornhill.no; helo=out-189.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317809 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Thu, Apr 18, 2024 at 6:49=E2=80=AFAM Eli Zaretskii wrot= e: >> >> > From: Jo=C3=A3o T=C3=A1vora >> > Date: Thu, 18 Apr 2024 01:24:59 +0100 >> > Cc: emacs-devel@gnu.org >> > >> > Let's say that during the Eglot session I visit both main.cpp >> > and mainlink.cpp in different buffers (either because I don't visit >> > them at the same time or because find-file-existing-other-name is >> > nil). Then I press M-? on lib.h's foo() to tell me who references it. >> > >> > Before you change, Eglot will -- correctly -- tell me there is a sing= le >> > user of lib.h's foo() function in my project. >> > >> > After your change, it tells me there are two users. This is wrong, >> > there is only one. >> > >> > It could be that some servers with direct access to the file system >> > can deduplicate the information and add back the symlink smarts. >> > >> > But clangd doesn't do this, and in general servers _can't_ do >> > this because LSP models a virtual file system. >> > >> > And for symlinks to large enough files, I'd be surprised if this >> > doesn't slow down the performance of the server because it has to >> > analyse what it is told is a completely new file. >> > >> > So this seems like a pretty big flaw to me after just minimal >> > surface scratching. Please reinstate the previous code. >> >> I asked exactly this question when the change was discussed, and was >> told that symlinks are not a problem. > > Surely not by me, and perhaps whoever told you this wasn't > considering this and other scenarios. Some funcionality works > >> If we need to support symlinks in Emacs instead of leaving this to the >> LSP servers, we could perhaps do that once in some strategic place, >> instead of using file-truename everywhere where normally >> expand-file-name would do. Or maybe explicitly test with >> file-symlink-p before using file-truename, which is (and has to be) >> pretty expensive. IOW, "punishing" everyone for the benefit of >> relatively rare use cases is not the best optimization. > > As far as I can tell, file-truename is (was) only used "naked" > once or twice, I think it's the use inside "find-buffer-visiting" which = is the > most crucial for the scenarios at hand. I'll try to see if I can separate > them. > > Jo=C3=A3o This is correct. The find-buffer-visiting is the most crucial one. Theo