From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Crake-Merani Newsgroups: gmane.lisp.guile.user Subject: Re: LSP Server for Scheme (and more ...) Date: Sat, 11 Jun 2022 09:37:21 +0100 Message-ID: <20220611083721.sly2yw77fnhiawlh@jamescrake-meraniarch> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27098"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: r.herdt@posteo.de Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Jun 11 10:37:50 2022 Return-path: Envelope-to: guile-user@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 1nzwcv-0006p7-TM for guile-user@m.gmane-mx.org; Sat, 11 Jun 2022 10:37:49 +0200 Original-Received: from localhost ([::1]:38932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzwct-0005D4-Uu for guile-user@m.gmane-mx.org; Sat, 11 Jun 2022 04:37:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzwcZ-0005Cs-2P for guile-user@gnu.org; Sat, 11 Jun 2022 04:37:27 -0400 Original-Received: from [178.62.35.155] (port=50940 helo=jamescm.co.uk) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzwcX-0007S0-68 for guile-user@gnu.org; Sat, 11 Jun 2022 04:37:26 -0400 Original-Received: from localhost (host86-163-79-80.range86-163.btcentralplus.com [86.163.79.80]) by jamescm.co.uk (Postfix) with ESMTPSA id B7FC460E8A; Sat, 11 Jun 2022 08:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jamescm.co.uk; s=mail; t=1654936641; bh=rM3+/QPvWiTp2gJHKzD23Vf1f9ct5k8oa1v6w+GfhjI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OeGdvEkAwMU5Il09yrBd+gupV/76b0uZ3m9c+XiVIccP4n5ItIrzR0aDoEMpWj1F7 HH6Nmi70LXjukC1eY/Ju/aoUj8ZhOyvryov4/3i4rjWtJ2zDvCXth3YQoLULbPJF8r vjM6sy8O/R8GzHGNivX8ZkqyPfyKtMS2zrjnirbUCQICLuCehKcsQEywG49uiyvW4q SkancEuyYYOOAAZdv3VKK9DxWeOQ+X3TR4nAkqLy6VkSZs4PsmDkYJNzS7/jYtqjdu 0oHjYaUCoI6i/x3GAggkBTi2mJGYbzEz89/E2EfTxOs76bIWAHYcDE/Q48QsMPEXPR vmxj4MAq5Yn2w== Content-Disposition: inline In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 178.62.35.155 (failed) Received-SPF: pass client-ip=178.62.35.155; envelope-from=james@jamescm.co.uk; helo=jamescm.co.uk X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18303 Archived-At: On 22/06/10 10:05pm, r.herdt@posteo.de wrote: > Hi Guilers! > > I want to share a couple of things I have being working on that you may find > useful. > > 1) I developed an LSP Server for Scheme. For those that don't know the > Language Server Protocol (LSP), it is meant for adding programming language > support for IDEs and editors that implement the protocol (nowadays most of > them support it). > > For now I am focusing on Guile 3 and CHICKEN 5. The idea is to write as much > R7RS for common code as possible (like representing documents, fetching word > under cursor etc.) and leave implementation specific code to dedicated > files. So far I managed to implement auto-completion, fetch signature, fetch > documentation and jump to definition. > > Repo: https://codeberg.org/rgherdt/scheme-lsp-server > > 2) An LSP server without a client is quite useless, so I'm also sharing an > emacs-lsp client: > > Repo: https://codeberg.org/rgherdt/emacs-lsp-scheme > > I will create a PR to melpa for this. Until it is merged, you can clone the > repo somewhere, 'load' it and follow the instructions in the README to > activate it. > > Usage is based on interaction with the REPL, which is based on Emacs's > built-in scheme inferior-mode. So you have to load the file (say by typing > C-c C-l on a buffer) in order to get access to symbols imported from other > modules. > > Note: for daily use you probably should stick to Geiser, since its Guile > support is obviously much more mature. It can still become useful for other > Schemes though, and is a good way to develop the LSP server without leaving > Emacs ;) > > 3) The whole idea behind LSP is to improve language support across multiple > IDEs/editors. So I started a proof of concept in VS Code: > > https://codeberg.org/rgherdt/vscode-scheme-lsp > > Since I don't use VS Code, I don't expect spending much time on it. I also > don't know how a lispy LSP client should/could look like in VS Code. If you > have ideas, or want to contribute/take over this, feel free to contact me. > It is not documented nor published yet, but already works for the > functionality mentioned (there are a couple of command to launch a REPL and > load files on it). I will investigate how to automate installation of the > LSP server before publishing it and let you know. > > Everything is on an early stage of development, and APIs may change. I > tested it using following software: > - Guile 3.0.8 > - Emacs 27.1 and 28.1 > - Debian Bullseye and Ubuntu 18.04 > > Any questions, suggestions, critics and contributions are more than welcome. > We can also reach me on @libera's #guile, #chicken, #scheme channels by the > name rgherdt. > > Have a nice weekend you all! > > Ricardo > > Hi, Thanks for your work on this. As others have made the point, something like this is valuable for making more editors viable for working in Guile. LSP is a great way to do it thanks to its compatibility with most modern editors.