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.devel Subject: Re: master 08c80c45dde: Don't use file-truepath in Eglot (bug#70036) Date: Thu, 18 Apr 2024 08:49:19 +0300 Message-ID: <86o7a7fcf4.fsf@gnu.org> References: <171215083924.12380.5369373861551158668@vcs2.savannah.gnu.org> <20240403132719.A18EFC12C28@vcs2.savannah.gnu.org> <87il0fsufu.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24356"; mail-complaints-to="usenet@ciao.gmane.io" Cc: theo@thornhill.no, emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 18 07:49:55 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 1rxKeh-00063I-LV for ged-emacs-devel@m.gmane-mx.org; Thu, 18 Apr 2024 07:49:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxKeE-0001wC-Gr; Thu, 18 Apr 2024 01:49:26 -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 1rxKeB-0001vo-I9 for emacs-devel@gnu.org; Thu, 18 Apr 2024 01:49:24 -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 1rxKeA-0003OZ-PZ; Thu, 18 Apr 2024 01:49:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=9T6PsdkLsZewBF2tNxj7L8zJtJvpT8gzP1fDUYGk73A=; b=lXriWqtkKoweFzCA60HP WCM/U/GB5WRVHfvyeIRSdVWBjh3SlOcnjUSvh5FO78Z5v9KE5bmJvGIuQThXe88AaSyOUpi4nKG2e OCZQ07M6i8bkQENggtvcgsekzc73F3AXT+F77dK29tJwEtANUKcqNbilhqwU0xCIyn88GJIRnK01v 6RoFGHwwRP5NcEOREcU6jdnRrhZqdafZhWtsQI9+ckviJq00N0ZtHahHFXhZGrVLd/YYTxKtfcn1z hMeJY65kvd1r5bDu8az1Cipe15Rjz4ZXiihYLmMNN4i7Byd5eoKr01IYGv07lf0GGNyE/jOOwatpo hH2sOJoPh6cadg==; In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Thu, 18 Apr 2024 01:24:59 +0100) 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:317794 Archived-At: > From: João Távora > 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 single > 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. 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.