From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Lina Bhaile" Newsgroups: gmane.emacs.devel Subject: Eglot rename, create, delete support Date: Mon, 04 Mar 2024 19:18:36 +0000 Message-ID: <7d6032f1-33e3-41aa-82b7-5b1b032bf0e1@app.fastmail.com> 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="29666"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.11.0-alpha0-208-g3f1d79aedb-fm-20240301.002-g3f1d79ae To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 04 20:19:57 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 1rhDqs-0007QW-I6 for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Mar 2024 20:19:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhDq5-0007jb-18; Mon, 04 Mar 2024 14:19:05 -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 1rhDq2-0007hL-HA for emacs-devel@gnu.org; Mon, 04 Mar 2024 14:19:02 -0500 Original-Received: from flow1-smtp.messagingengine.com ([103.168.172.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhDq0-0002UJ-K6 for emacs-devel@gnu.org; Mon, 04 Mar 2024 14:19:02 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailflow.nyi.internal (Postfix) with ESMTP id 88CCF20020A for ; Mon, 4 Mar 2024 14:18:57 -0500 (EST) Original-Received: from imap53 ([10.202.2.103]) by compute3.internal (MEProxy); Mon, 04 Mar 2024 14:18:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linabee.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm1; t=1709579937; x=1709583537; bh=HpmIWs5m6B 3s5k9ccBpTului8N0FyuhqoXKbqtQVHy8=; b=WE7fTcc3kRN5r3rNr5A76xJGNI BOumI/UYQ0bDV3CXcwJQcn5tXTn/7UXYL0gGm9ErQgV/AMbhd0dV+sbi4GvOr+c8 hids0Z+dwllcVv/QqAvfRnGGkmetSuQBViECh28jLSi6gGV30STbYsH3sn6ig08V BQFfoRV7U+SPbZ/xJ/KRfLJXRBtGknOFfhu9EK2FymKpZNHeiM8mM2HPatrRsgew NDuXCs1WhEwaYN5EQ1BdsKYjhIRZJpm4KuVIGU+uOOBdxaIBxBEBSA+N8YA3XpjS XztPgAGRl+DG982MH7tHOgtfghSgcRHwFJP8eWzpjq1KxKQ6+BUOrdIf4kwQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= ifbf14913.fm1; t=1709579937; x=1709583537; bh=HpmIWs5m6B3s5k9ccB pTului8N0FyuhqoXKbqtQVHy8=; b=AC7k6Cb9LXsh/YPWnS02WRpuYvsymGWp3s oOEv5j9+J6ozS/fetMOTTOch6H4mIozwpIictmGyARsLxodwmwYrdTF9L9KlOb32 4yxa/vuAtpQnM8jGl8GB2/OMnLD83+KjbVelnixkIQn9fm/0VZhmcINkmMQroYPU nk2dZFMdX3L4JqIQC4In8FPXoKqX7AbFgfONUAe4bDQXNEn2Gu6YkK0T/sV8aGKW b85nERubWADwtCt0K5rboK9Mc0Owwvw0wSXzUNDPlJ2WpThYvnAmtSiJ4eSG269C gO7J1A8b0LNuVzWdFDZ8azZxqtxXaNKE1DJS8NXwdEd/NG5TFnuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheejgdduvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffohhmrghinhculdegledmne cujfgurhepofgfggfkfffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfhinhgr uceuhhgrihhlvgdfuceovghmrggtshdquggvvhgvlheslhhinhgrsggvvgdruhhkqeenuc ggtffrrghtthgvrhhnpefhfeejkedtieegfedvvdfgleetgeefvdevleehgfekheefheet tdeuieevleeghfenucffohhmrghinhepghhithhhuhgsrdhiohenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvmhgrtghsqdguvghvvghlsehl ihhnrggsvggvrdhukh X-ME-Proxy: Feedback-ID: ifbf14913:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 31A9B364006F; Mon, 4 Mar 2024 14:18:57 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Received-SPF: pass client-ip=103.168.172.136; envelope-from=emacs-devel@linabee.uk; helo=flow1-smtp.messagingengine.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:316808 Archived-At: (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 t= he project if the client advertises that it can do =E2=80=9CresourceOperati= ons=E2=80=9D [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=E2=80=99s particularly useful for Java since the compiler for that language refuse= s to compile a file if the name of a type does not match the file name, as we= ll 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 ve= ry 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 i= t on the list but I do not have my copyright assigned yet, it's pushing aroun= d 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 l= ike to handle all the potential corner cases that might arise. If someone could send me the copyright assignment forms that would be gr= and. Lina