emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

jsonrpc.el closer to merging


From: João Távora
Subject: jsonrpc.el closer to merging
Date: Sun, 10 Jun 2018 16:56:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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: jsonrpc.el
Description: application/emacs-lisp


reply via email to

[Prev in Thread] Current Thread [Next in Thread]