Re: [code] [textadept] New Language Server Protocol client module

From: Chris Emerson <>
Date: Sun, 30 Sep 2018 21:29:25 +0100

Hi Mitchell,

On Mon, Sep 17, 2018 at 09:27:16PM -0400, Mitchell wrote:
> I've been working on an experimental client module[1] for Textadept that
> communicates over the Language Server Protocol[2] (LSP) with language
> servers in order to provide autocompletion, calltips, go to definition, and
> more.

Nice! I've been wanting to try out the Rust Language Server[1], but haven't
really got on with IDEs I've tried so far. :-)


> **Also note that some buggy language servers that do not respect the
> protocol may cause this module and Textadept to hang, waiting for a
> response. There is no recourse other than to force-quit Textadept and
> restart. You have been warned.**

I've experienced this, but I'm not sure who's at fault. :-)

The attached rough patch (against b5beae87e409, or at least that's the name
of the ZIP file I got from hg) gets through that, though might not do it
the best way. The changes are:

1. The 'initialized' message seems to need an empty object rather than
nothing. Otherwise the RLS returns an error.
2. The lines come back with \r\n line endings, and the lines end up with
'\r' at the end and don't match the "Content-Length" pattern, plus
`#line > 0` is always true.

I haven't yet worked out how to get information out of it, but at least
it doesn't hang on opening a Rust file now. :-) I use
`_M.lsp.server_commands.rust = 'rls'` after installing it.



You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sun 30 Sep 2018 - 16:29:25 EDT

This archive was generated by hypermail 2.2.0 : Mon 01 Oct 2018 - 06:31:52 EDT