GNU bug report logs -
#63372
[PATCH] Add variable: eglot-apply-text-edits-function
Previous Next
Full log
Message #14 received at 63372 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
João Távora <joaotavora <at> gmail.com> writes:
>> >> 3. Eglot uses the eglot--apply-text-edits defun to apply server
>> >> initiated edits. There is an extension that allows the server to
>> >> send the edits in a different format (snippet-text-edits).
>> >>
>> >> Eglot-x puts an advise on eglot--apply-text-edits to check the format
>> >> of the edits and act accordingly.
>> >>
>> >> I don't know how to avoid this advice.
>> >
>> > Some hook or function variable, perhaps? If they don't exist, perhaps
>> > they could be added?
> But then, I wonder, since most of Eglot's API is already CLOS
> based, isn't a generic function best? A generic function can
> have :around methods, and if we follow the convention of
> passing the server as the first argument, third parties
> can make server-specific extensions.
You're right, I think. In the attached patch, I simply changed
eglot--apply-text-edits to a cl-defgeneric and renamed it. The patch is
straightforward, but I had to eliminate a cl-return-from call, because
generic functions don't seem to support that.
Thanks.
[0001-Eglot-Replace-eglot-apply-text-edits-with-a-public-f.patch (text/x-diff, attachment)]
This bug report was last modified 123 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.