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

From: Chris Emerson <c-ta.att.mail.nosreme.org>
Date: Mon, 1 Oct 2018 23:51:35 +0100

On Mon, Oct 01, 2018 at 04:50:55PM -0400, Mitchell wrote:
> On Sun, Sep 30, 2018 at 09:29:25PM +0100, Chris Emerson wrote:
> >* I've seen notifications from the server being split across reads (e.g.
> >the "Content-Length: 1234\r\n\r\n" in one read, and the actual message in
> >the next). I can see that's not handled yet.
>
> Yeah, there's a TODO around line 286 for handling split messages properly
> via some sort of buffering. Since the LSP module isn't expecting
> notifications, it passively reads in stuff and tries to interpret it in a
> simplistic way. Thus, notifications from servers like diagnostics will
> probably not work 100% of the time. In my testing and usage though,
> anything you ask of the server (completions, goto definition, etc.) will
> work all of the time without getting split messages.

In my logs of what handle_stdout() is given, I see a lot of broken messages
(or that would appear broken once the ^M issue is sorted out); it looks like
it's line buffered so the JSON message often arrives with the
"Content-Length: 123\r" appended to the end, and the next message comes in the
next call.

I'm using strace on the rls which might affect the buffering, but I can also
see that the RLS is writing the headers part in a separate `write` system
call to the JSON itself, so I don't think it'll work that well for me without
handling split messages. I might try to get something working though.

Thanks,

Chris

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 01 Oct 2018 - 18:51:35 EDT

This archive was generated by hypermail 2.2.0 : Tue 02 Oct 2018 - 06:29:41 EDT