Skip to content

Strange error when subscribing to unhandled notifications #6

Open
@Kethku

Description

@Kethku

Error invoking 'poll' on channel 92:^@ch 92 sent an invalid message, closed

I get the above error when registering commands like so:

using System;
using System.IO;

using NvimClient.API;
using NvimClient.API.NvimPlugin.Attributes;
using NvimClient.API.NvimPlugin.Parameters;

namespace Suggestions {
    [NvimPlugin]
    public class SuggestionsPlugin {
        private readonly NvimAPI nvim;
        private StreamWriter log;


        public SuggestionsPlugin(NvimAPI nvim) {
            this.nvim = nvim;
            log = File.AppendText("./logs");

            this.nvim.OnUnhandledNotification += UnhandledNotification;
        }

        [NvimFunction]
        public async void Test() {
            var currentBuffer = await this.nvim.GetCurrentBuf();
            currentBuffer.Attach(true, null);
            this.nvim.OnUnhandledNotification += UnhandledNotification;
        }

        public void UnhandledNotification(object sender, NvimUnhandledNotificationEventArgs args) {
            log.WriteLine(args.MethodName);
        }
    }
}

Any ideas whats going on? Its hard to debug this without much in the way of documentation/examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions