From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: New jrpc.el JSONRPC library Date: Mon, 21 May 2018 00:22:41 +0100 Message-ID: <87r2m5rjy6.fsf@gmail.com> References: <87lgcrqgvz.fsf@gmail.com> <831seipvdb.fsf@gnu.org> <871se9lyid.fsf_-_@gmail.com> <83r2m8ghiq.fsf@gnu.org> <877enys4ot.fsf@gmail.com> <90d77452-87f2-50b3-4757-bceaacc144f5@gmail.com> <2DEC39CE-E4A9-496E-89BF-A4EAD63076DA@elsasser.ca> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1526858457 12230 195.159.176.226 (20 May 2018 23:20:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 May 2018 23:20:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel , emacs-devel@gnu.org To: Josh Elsasser Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 21 01:20:53 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fKXdA-0002xJ-0P for ged-emacs-devel@m.gmane.org; Mon, 21 May 2018 01:20:48 +0200 Original-Received: from localhost ([::1]:47971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKXfF-00034u-LK for ged-emacs-devel@m.gmane.org; Sun, 20 May 2018 19:22:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKXf8-00034c-Fq for emacs-devel@gnu.org; Sun, 20 May 2018 19:22:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKXf5-0005RR-AD for emacs-devel@gnu.org; Sun, 20 May 2018 19:22:50 -0400 Original-Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:40249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fKXf5-0005RL-3L for emacs-devel@gnu.org; Sun, 20 May 2018 19:22:47 -0400 Original-Received: by mail-wr0-x234.google.com with SMTP id v60-v6so14230117wrc.7 for ; Sun, 20 May 2018 16:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=6g/8m7hv+zpo+AeAdEsn8ObtEL1Xzb6pHeZAqfdkAw8=; b=vbYR3duTDWczZISAQ6TQlgDt7PsOOM9ruG5qBRcK/mjdlov38zCio2q9aq8wKdh5HN rncwGPdHwRjIjlaW9puqF1GNtd+HXixZ5ca3Kgum8Hucw2M6ABJq6KO/mn/vPQm3WLs5 +rbk3SmyuRiL73vHDZPVJa50nmpLmu6Qks2+3tZig4vdLLT+8iAx8kNYYRXFionksxgb oGy07GZ6+J0zVMxbctdd2gidSUl5VEM98R8XbAqwF2SgkftjUC3eGpXFB3PC8XLLGauO Bdo0RpE5+8R6pOxDz8z69pYggslauo5Oy/bR7I5p0nnQBZvaQnAPNo7gbzXCLjvjt/vh h/ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=6g/8m7hv+zpo+AeAdEsn8ObtEL1Xzb6pHeZAqfdkAw8=; b=VihKdpL3nVsN9l4wcGiTvMN/h3OOed4nvApILK7ddbX85aMH09TF89ANAzIw/kOkf1 IAODce8m/Mw++BJ+ZfxqPqyxU5TgTYxdVvc2vrPrn+oJpKjjTtWZecnIRPOVMqfooPfx XUnURSrTkQBzIodyHTaF+GoZuJxiOYf6rwS8Ug9me1yigHBAtEAsAp4j8BTRA+CxZHyv v44VDAU0VjLzihLjVWwLxPpRS5LQYpk5SJvEzq6QlgvAWhUaj56f1IKh1nOdxTOj+6eB Sv6vlduu6aieYx3+WSiCWHbZ7gVBRQyqdBnd+JDrmXk5qthlYh60tEoEQ6ShVXN6iuMI +G8Q== X-Gm-Message-State: ALKqPwcCryhYEzGdjtFd564CWkCflYBbBkS8nGI9Er7N+9OhqANgYl8k qNmKSXzNHtUufXHNLeoZGxQciiG0 X-Google-Smtp-Source: AB8JxZqB7eA95lFY2ux/TEZgU+okA/YIx71wT8+dbEqgdB9IOQsbpqj1eEBiiNt19chss9JNicnSQw== X-Received: by 2002:adf:8584:: with SMTP id 4-v6mr15350781wrt.15.1526858565688; Sun, 20 May 2018 16:22:45 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id 32-v6sm722782wrf.33.2018.05.20.16.22.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 May 2018 16:22:44 -0700 (PDT) In-Reply-To: <2DEC39CE-E4A9-496E-89BF-A4EAD63076DA@elsasser.ca> (Josh Elsasser's message of "Sun, 20 May 2018 13:35:14 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225494 Archived-At: Josh Elsasser writes: > On May 20, 2018, at 12:13 PM, Cl=C3=A9ment Pit-Claudel wrote: >> On 2018-05-20 11:54, Jo=C3=A3o T=C3=A1vora wrote: > After working through the eglot.el source, it looks like the same > thing could be managed by just defining a > `eglot=E2=80=94server-myLangServer/customMethodName` handler. The API for > sending/receive input from the server looks really clean, too -- the > various custom extensions floating around out there could easily be > implemented as langserver-specific packages with a depend on eglot.el Thanks for the positive feedback, and indeed creating a clean API was a design goal, but notice that: (cl-defun eglot--server-myLangServer/customMethodName (proc &key param1 param2) ...)=20 has two dashes in it. It isn't (yet) a part of the official eglot.el LSP API, and your particular example might very well become something like: (cl-defmethod eglot-handle-notification (proc (method (eql :myLangServer/customMethodName)) &key param1 param2) ...) or, for requests (cl-defmethod eglot-handle-request (proc id (method (eql :myLangServer/customMethodName)) &key param1 par= am2) ...) This seems cleaner than the "automagical" function names, although it has two minor drawbacks: 1. M-x imenu won't let me search methods by their specializers 2. eldoc mode doesn't highlight :param1 and :param2 while writing a method call (but this isn't really a problem in this case because you're not going to be writing the function calls yourself). Jo=C3=A3o