all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: me@linabee.uk
To: emacs-devel@gnu.org
Subject: Eglot rename, create, delete support
Date: Mon, 4 Mar 2024 18:00:44 +0000	[thread overview]
Message-ID: <5A6D57A0-DE9A-445A-9BB7-F7359F9A0B1D@linabee.uk> (raw)

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.

   	   Lina


             reply	other threads:[~2024-03-04 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 18:00 me [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-04 19:18 Eglot rename, create, delete support Lina Bhaile
2024-03-04 20:14 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A6D57A0-DE9A-445A-9BB7-F7359F9A0B1D@linabee.uk \
    --to=me@linabee.uk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.