From: "João Távora" <joaotavora@gmail.com>
To: emacs-devel@gnu.org
Cc: p.stephani2@gmail.com, Eli Zaretskii <eliz@gnu.org>,
monnier@iro.umontreal.ca, vibhavp@gmail.com
Subject: jsonrpc.el closer to merging
Date: Sun, 10 Jun 2018 16:56:08 +0100 [thread overview]
Message-ID: <87sh5uvdnr.fsf@gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2018-06-10 15:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-10 15:56 João Távora [this message]
2018-06-10 17:56 ` jsonrpc.el closer to merging 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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sh5uvdnr.fsf@gmail.com \
--to=joaotavora@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=p.stephani2@gmail.com \
--cc=vibhavp@gmail.com \
/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 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).