From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Brooks Newsgroups: gmane.emacs.devel Subject: Re: Elisp LSP Server Date: Thu, 04 Nov 2021 22:55:00 -0700 Message-ID: <877ddnqh8r.fsf@db48x.net> References: <16338bdc2497fc51c6fb6d54ab370bfb@webmail.orcon.net.nz> <8100571.MQnaI0vtd3@galex-713.eu> <2131617.6ipFHDhFrr@galex-713.eu> <97672d50-e183-445d-9661-5fec61ae5a96@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5095"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cc: jostein@kjonigsen.net, galex-713@galex-713.eu, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 06:56:33 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1misDI-00018O-EW for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 06:56:33 +0100 Original-Received: from localhost ([::1]:51938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1misDG-0005qF-JL for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 01:56:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1misBx-0004vL-PH for emacs-devel@gnu.org; Fri, 05 Nov 2021 01:55:09 -0400 Original-Received: from smtp-out-4.mxes.net ([2605:d100:2f:10::315]:38300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1misBt-0008BP-NT for emacs-devel@gnu.org; Fri, 05 Nov 2021 01:55:09 -0400 Original-Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 4HlqTx5qY8z3c9P; Fri, 5 Nov 2021 01:55:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1636091702; bh=dcaopxu5p2XJQfkwV5E/y7D/U8GS7j5lCbZapW3bXIo=; h=From:To:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=DJhwzDexQh3v4ZigE/wkqoJheSURGN3v25zxwQxtnDMtZ/Fqty9EL5+xaLVr0Xk/T sjn8jhlRjYS3EWhwHb2qtLOHTAKq9vYp3g3oFNzM7+OoXGaPCXhaazMzySsPSzcYJx dUBp58YxqBMn2dkVTlc5NdObvaILaDs8dJnJ2xoA= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGOfPtRkwAAABJQ TFRFpKfbdou67PD6JjJgAwUWXGSeIcyLHgAAAkZJREFUOI1VU8Fy6yAMxLi+Q13fCZ3cnQL3dqTc 7RD+/1feStDXVnXHDuvVSivZTMba2GPdw3gyCGcMAFxTyrTd9dwGoxHiZX9PmRFUHYAQlGGtXY+F Uk0SJOxgJiUEnH1qkitT9D+pQub7qGAmUbR6bu3CvI96Yv6QqkBBMrsyfZccr1/RDXGDTLf4P7ZY glVxe2V+/ACXWO1gvDO9/gDRpFFVmPluvLcmBjd5H6d8DEte+Pbk4rcY/Fa5tLKLOtCZsuQKYhpa LOkYDT7hESya7/WIET3lfQBqX0pwFtbI832Is0ayMUR9B+12xjgPCQ089cfwkCkX6L5TPmRelJTh zMS0Sz1PyjLAMCUWjcmgQLWQMds+e3aaauZDf9dU9A2/8kPVF2odCUoMKHkfjJR+mbgC+DRiycw5 3XSqGe6HmhN/AWjHypkAXOAFW5EiuA1ge2GiZuMb0s1fSEXcATeLUfbyEY2L8yPOmdSsdghQXx3K pz2eoeXuYvMCINVFDrCdNfVUp4eJ6cSEbjbgFjBEvonGGTrgv9cHjAc8aVgSAPoxaONbzfwhDIhR at7IIS7fAGiDSwIA9alhhTBzfA7YM2FY6eMwayrIGK8FDFmshmUA43WqhFtpvoqG9HHaJ7fqtgTz 8EWVkgZgtsylFliHDgk0MB7KAEC45C/rgnGvanNLXyzOeTzcT2nw/N44gfrtYXRQLoz9Q3TgmJRx 2Mx/Q51qzpm+l3m8z2SWBqC5+PZXAtNYlGFf/gKfHfjFkDT4x7od7R+w3Ls+ZdQBuQAAAABJRU5E rkJggg== In-Reply-To: (Richard Stallman's message of "Thu, 04 Nov 2021 23:53:42 -0400") X-Sent-To: Received-SPF: none client-ip=2605:d100:2f:10::315; envelope-from=db48x@db48x.net; helo=smtp-out-4.mxes.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:278736 Archived-At: Richard Stallman writes: > > An LSP-server is actually software running on your own machine, > > but in a different process. And it=E2=80=99s very often free software= too! > > I understand about having Emacs invoke a language server. > (Is an "LSP server" the same thing as a language server? > It isn't obvious.) It is. LSP stands for =E2=80=9Clanguage=E2=80=93server protocol=E2=80=9D. I= t=E2=80=99s a protocol for an editor and a language compiler or runtime to exchange information. The editor sends queries that generally correspond to the user=E2=80=99s action= s, and the server sends back information the editor can use to complete that action. For example, if I am editing a C program in Emacs, I can call `xref-find-definitions' and it will find the identifier at point, consult my TAGS file, and jump to the definition of that identifier. With an LSP server, Emacs instead sends the filename and the location of point to the server, and the server sends back a list of filenames and locations where the definition(s) are. This frees Emacs from having to know very much about the specific language, and frees language designers from having to teach every text editor in the world about their new language. > But we were talking about having a web browser invoke Emacs. > How does the language server relate to that? I admit I wasn=E2=80=99t following the discussion, but I think that it is becoming more common for people to run large applications inside the browser. Specifically, GitHub is doing something with VSCode. By running VSCode in the browser, GitHub can provide an IDE for any project hosted there, which is hoped to be a powerful feature for attracting new developers to submit code to those projects that use it. I haven=E2=80=99t = tried it myself, but I see no technical obstacles to this. I myself helped in some small ways to get MAME emulated arcade machines and consoles running in the browser for https://archive.org/. Anyway, VSCode tries to make it as easy as possible for their users to get started programming in their favorite languages. The VSCode user can generally go to a list of plugins inside of VSCode, find one for their language, check the checkbox next to it, and more or less immediately start programming in that language, complete with LSP integration. (This is not much different from running `package-install', for example, except that it can and does install binaries on your system). Within Emacs, `lsp-mode' offers integration with LSP servers, and it has a function `lsp-install-server' which can automatically install some of them. If Emacs were to act as an LSP server, then in principle VSCode could offer an Elisp extension which would download Emacs for the user. It wouldn=E2=80=99t be for use as an editor, but just for use as the LSP serve= r for the elisp code that the user is editing in VSCode. Incidentally, Microsoft owns GitHub and VSCode, and they started the LSP protocol specification specifically for use with VSCode back in 2016 (although the direct inspiration, I suspect, comes from a post by Steve Yegge at Google a few years prior). >From the point of view of most developers of text editors, and most language designers, the LSP protocol makes sense. It reduces the amount of work that they all have to do to support each other. On the other hand, the specification is quite closely tied to the needs of VSCode. It is called an open standard, but having taken a look at it I can see that it is just whatever VSCode happened to support at the time it was published, plus some extensions since then. Perhaps it can grow from there. I don=E2=80=99t see any particular need for Emacs to be a language server f= or Elisp, but there is nevertheless an argument for it. For example, it is not much different than allowing users to export word=E2=80=93processor documents in formats that can be read by your competitors. As far as I know, Microsoft Office does not give the user the option of exporting their document as an OpenOffice file, but OpenOffice does allow exporting documents as Microsoft Office files. Microsoft Office tries to keep people from straying from Microsoft products, while OpenOffice does not. Even so, I think it would be significant work for not much benefit. I hope something in that ramble was helpful! db48x