From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: me@linabee.uk Newsgroups: gmane.emacs.devel Subject: Eglot rename, create, delete support Date: Mon, 4 Mar 2024 18:00:44 +0000 Message-ID: <5A6D57A0-DE9A-445A-9BB7-F7359F9A0B1D@linabee.uk> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) 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="1865"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 04 21:05:04 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 1rhEYa-00009w-Ba for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Mar 2024 21:05:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhEXm-0005V1-1u; Mon, 04 Mar 2024 15:04:14 -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 1rhCcU-0007dw-BM for emacs-devel@gnu.org; Mon, 04 Mar 2024 13:00:58 -0500 Original-Received: from ms11p00im-qufo17281801.me.com ([17.58.38.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhCcQ-0005zG-2x for emacs-devel@gnu.org; Mon, 04 Mar 2024 13:00:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linabee.uk; s=sig1; t=1709575247; bh=Wxg30SDU7pv5CvVagYLlhcpDJThF8wdb9zEyfqPn92s=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=n0xkKGaWFBnAp2/Bz8Apvi6pIRN+DIWN3Ialm1jFQ6qN53+DJbW71RNr3UN0P2MgS T6wz3SnOrodcAMrPlyK6rfytWgnrE1aI54imgdtAlIYRpl2NODB/sTLSPBSkhtfvn7 U+NnVDS/j6VkbhujxC16Zr9uEEledCI0tPsojhg7SjXgInysCeiQyreJON6EXcOrh9 Ed5svDr9L87PMiKwRdDdws8EA5T06ruITrtHRdMBdMlmrxfZta81QfAXsux3fECe9j lMi7/puhTTbOXIVmkfTx4vtiPorNl1+kpY3vbKkEMscxWtzrfg8rh9SX/QGDSVdfRQ bdVpJrRqJKxWw== Original-Received: from smtpclient.apple (ms11p00im-dlb-asmtpmailmevip.me.com [17.57.154.19]) by ms11p00im-qufo17281801.me.com (Postfix) with ESMTPSA id 41369AC0300 for ; Mon, 4 Mar 2024 18:00:46 +0000 (UTC) X-Mailer: Apple Mail (2.3774.400.31) X-Proofpoint-ORIG-GUID: bSo4T_ujASRZHu3lERrMUJfvSf5kBNrz X-Proofpoint-GUID: bSo4T_ujASRZHu3lERrMUJfvSf5kBNrz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-04_13,2024-03-04_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 clxscore=1030 mlxlogscore=714 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2403040137 Received-SPF: pass client-ip=17.58.38.55; envelope-from=me@linabee.uk; helo=ms11p00im-qufo17281801.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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-Mailman-Approved-At: Mon, 04 Mar 2024 15:04:12 -0500 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:316809 Archived-At: 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 =E2=80=9CresourceOperation= s=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 = 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. Lina=