neovim / neovim-ruby

Ruby support for Neovim
MIT License
340 stars 17 forks source link

set client info after connecting #60

Closed justinmk closed 5 years ago

justinmk commented 5 years ago

Nvim 0.3.2+ has nvim_set_client_info API method, so that clients can provide hints about their identity and purpose.

Example from pynvim https://github.com/neovim/pynvim/pull/350 host (later enhanced in https://github.com/neovim/pynvim/pull/399):

        if len(plugins) == 1 and has_script:
            kind = "script"
        else:
            kind = "rplugin"
        name = "python{}-{}-host".format(sys.version_info[0], kind)
        attributes = {"license": "Apache v2",
                      "website": "github.com/neovim/python-client"}
        self.nvim.api.set_client_info(
            name, VERSION.__dict__, "host", host_method_spec,
            attributes, async_=True)
alexgenco commented 5 years ago

Sorry I've been out of town, I'll look into this in the next few days

alexgenco commented 5 years ago

@justinmk Not sure if I'm reading this correctly, but is the method spec always hardcoded to "poll", "specs", and "shutdown" even for remote plugin hosts? Looking at this: https://github.com/neovim/pynvim/blob/4dd9962c47bc9d48dc01d7cdf99e3c9819e97548/pynvim/plugin/host.py#L23

justinmk commented 5 years ago

@alexgenco for non-host client, pynvim sends {} for the method spec. I'm not sure if that should be changed, I didn't think about it much.

alexgenco commented 5 years ago

resolved in https://github.com/neovim/neovim-ruby/pull/61

alexgenco commented 5 years ago

Forgot to release this until just now: https://rubygems.org/gems/neovim/versions/0.8.1