unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* jsonrpc.el closer to merging
@ 2018-06-10 15:56 João Távora
  2018-06-10 17:56 ` Clément Pit-Claudel
  2018-06-11  1:46 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: João Távora @ 2018-06-10 15:56 UTC (permalink / raw)
  To: emacs-devel; +Cc: p.stephani2, Eli Zaretskii, monnier, vibhavp

[-- Attachment #1: Type: text/plain, Size: 2416 bytes --]

Hi,

The last few weeks, I've been getting jsonrpc.el ready for integration
into core (master/26.2) and/or ELPA.git.

There's a new version after my sig, or you can find it in the
jsonrpc-refactor branch of:

   https://github.com/joaotavora/eglot

The `;;; Commentary:' section contains an introduction to the mostly new
API and the rudiments of a future manual, as do the dostrings.

I think I have addressed most comments posted here by reviewers, to whom
I'm very grateful:

- The API library is based on a single `jsonrpc-connection' eieio class
  and some cl-generic functions;

- That class is abstract, so it's no good to use on its own, you have to
  subclass it. There is, however, a `jsonrpc-process-connection'
  transport suitable for LSP (and possibly other uses), which also
  serves as an example transport implementation.

- eglot.el (in the jsonrpc-refactor branch) is working on top of the new
  library and servers as an example application implementation, as do
  the tests in jsonrpc-tests.el;

- The library works with json.c if it is available, or json.el in its
  absence, which makes it compatible with Emacs 26.1.

  Note that if json.c is available, the library expects it to accept
  customizable null and false types in json-parse-string and
  json-serialize, which is a patch that I'm still waiting for comments
  on;

- The library exchanges JSON objects with the client as plists.  I still
  haven't gotten a very convincing argument to do so, but it could be
  made plist/alist/hashtable-agnostic. This would probably amount to
  writing a `jsonrpc--destructure-json' which autodetects the map type
  and using it instead of `cl-destructuring-bind';

- tests aren't extensive, but they do cover some tricky corner cases.
  eglot's tests are also passing on top of the new jsonrpc.el.  The
  "deferred actions" code has been cleaned up of many bugs (thanks to
  Filipp Gunbin) but perhaps it would be wise to write tests for those;

- The `jsonrpc-process-connection' class sends the Content-Type header
  along with Content-Length;

- There is no more functions
  jsonrpc-current-connection/jsonrpc-current-connection-or-lose.  There
  are also no more interactive functions.  Applications should implement
  those;
  
- There are no defcustoms;

After integration, I can write up the proper docs and NEWS entry.

João


[-- Attachment #2: jsonrpc.el --]
[-- Type: application/emacs-lisp, Size: 32625 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-13 10:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-10 15:56 jsonrpc.el closer to merging João Távora
2018-06-10 17:56 ` Clément Pit-Claudel
2018-06-10 22:36   ` João Távora
2018-06-11 13:08     ` Clément Pit-Claudel
2018-06-11 14:42       ` João Távora
2018-06-11 22:26         ` João Távora
2018-06-11 23:13           ` Clément Pit-Claudel
2018-06-13 10:19             ` João Távora
2018-06-11  1:46 ` Stefan Monnier
2018-06-11  6:34   ` João Távora
2018-06-11 12:30     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).