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: Eglot rename, create, delete support Date: Mon, 04 Mar 2024 22:14:06 +0200 Message-ID: <865xy1n4a9.fsf@gnu.org> References: <7d6032f1-33e3-41aa-82b7-5b1b032bf0e1@app.fastmail.com> 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="16768"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Lina Bhaile" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 04 21:15:08 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 1rhEiJ-00048o-T4 for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Mar 2024 21:15:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhEhb-00080R-Q4; Mon, 04 Mar 2024 15:14:23 -0500 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 1rhEha-0007zz-6R for emacs-devel@gnu.org; Mon, 04 Mar 2024 15:14:22 -0500 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 1rhEhZ-0004Q5-Rx; Mon, 04 Mar 2024 15:14:21 -0500 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=obeuBqRh78cUY406Tu8k+MH1gHVcEfv3alSkaqC/V5A=; b=Jlx9W/nYRUntgThnaifj x78XUIE2eFxnJJi+IURpwb77JIXeq0hvsbBSUaWCWaJz4Ib4QxmXVf3yeUhfWLKs8x/obiZCoaC9r vFLw20tBVjL70KGJtDIAHqcfvg3Nt7ETebgEFrsB+PYHL7eYRjfKLgUtmmrtJiPpsi/17TXdeEGz8 ZWf6H315GYJjOX0rbztylUYk879eUGraRgU+tfBuAE8teV6mPwAgLQ5FIdI39mxJ5LH3Y7DmyWhdZ 1zGrJEY0mcKdsQgUWG2iAZNJBERMTd6aIHah8qABF0MWULbsPmV9Yx+NRFVddsEK0yyw8j5YACw7/ hHfFdGJ/TuImCw==; In-Reply-To: <7d6032f1-33e3-41aa-82b7-5b1b032bf0e1@app.fastmail.com> (emacs-devel@linabee.uk) 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:316811 Archived-At: > Date: Mon, 04 Mar 2024 19:18:36 +0000 > From: "Lina Bhaile" > > (Resending due to wrong From:) > > Hi all, > > The Language Server Protocol spec allows for servers to send requests to the > client (in this case Emacs/Eglot) to create, rename or delete files in the > project if the client advertises that it can do “resourceOperations” > [https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#resourceChanges]. > Unfortunately Eglot does not support this in either HEAD or in Emacs 29. It’s > particularly useful for Java since the compiler for that language refuses to > compile a file if the name of a type does not match the file name, as well as > code actions for moving types from one package (namespace) to another. > > I have a patch that adds support for rename requests to Eglot inside an > extension package for connecting to a Java language server, but it is very > hacky because it needs to advise eglot--apply-workspace-edit which will > mishandle parsing if it encounters an object with a different type than > TextDocumentEdit inside a workspace edit response > [https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspaceEdit]. > Really, though, this code should be inside Eglot itself. I would share it on > the list but I do not have my copyright assigned yet, it's pushing around 125 > lines with just rename support. As well I would like some review and to write > some tests as these are potentially destructive operations and I would like to > handle all the potential corner cases that might arise. > > If someone could send me the copyright assignment forms that would be grand. Form sent off-list. When you are ready with the patch, please post it to our issue tracker using "M-x submit-emacs-patch", preferably in the form generated by "git format-patch". You could post it while your legal paperwork is still in progress, because patch review takes some time, and you might get review comments to follow up on. Thanks.