kiteco / issue-tracker

User-reported issues for Kite
https://Kite.com
1.75k stars 136 forks source link

vim 8.0.0071 gives error about "drop" parameter for ch_open call #102

Closed ahakanbaba closed 6 years ago

ahakanbaba commented 6 years ago

Once I switch to a python file in my mac with vim 8.0.0071 I get the following error

Error detected while processing function kite#bufenter[8]..kite#status#status[4]..kite#utils#logged_in[4]..kite#client#logged_in[3]..<SNR>102_internal_http:
line   13:
E475: Invalid argument: drop
.....
....
..
Among many other errors this is the first one. 

In this version the ch_open call does not have the "drop" parameter yet This shows in :help channel-open-options

{options} is a dictionary with optional entries:        channel-open-options

"mode" can be:                                          channel-mode
        "json" - Use JSON, see below; most convenient way. Default.
        "js"   - Use JS (JavaScript) encoding, more efficient than JSON.
        "nl"   - Use messages that end in a NL character
        "raw"  - Use raw messages
                                                channel-callback E921
"callback"      A function that is called when a message is received that is
                not handled otherwise.  It gets two arguments: the channel
                and the received message. Example:
        func Handle(channel, msg)
          echo 'Received: ' . a:msg
        endfunc
        let channel = ch_open("localhost:8765", {"callback": "Handle"})

                When "mode" is "json" or "js" the "msg" argument is the body
                of the received message, converted to Vim types.
                When "mode" is "nl" the "msg" argument is one message,
                excluding the NL.
                When "mode" is "raw" the "msg" argument is the whole message
                as a string.

                For all callbacks: Use function() to bind it to arguments
                and/or a Dictionary.  Or use the form "dict.function" to bind
                the Dictionary.

                Callbacks are only called at a "safe" moment, usually when Vim
                is waiting for the user to type a character.  Vim does not use
                multi-threading.

                                                        close_cb
"close_cb"      A function that is called when the channel gets closed, other
                than by calling ch_close().  It should be defined like this:
        func MyCloseHandler(channel)
                Vim will invoke callbacks that handle data before invoking
                close_cb, thus when this function is called no more data will
                be received.
                                                        waittime
"waittime"      The time to wait for the connection to be made in
                milliseconds.  A negative number waits forever.

                The default is zero, don't wait, which is useful if a local
                server is supposed to be running already.  On Unix Vim
                actually uses a 1 msec timeout, that is required on many
                systems.  Use a larger value for a remote server, e.g.  10
                msec at least.
                                                        channel-timeout
"timeout"       The time to wait for a request when blocking, E.g. when using
                ch_evalexpr().  In milliseconds.  The default is 2000 (2
                seconds).
When "mode" is "json" or "js" the "callback" is optional.  When omitted it is
only possible to receive a message after sending one.
ahakanbaba commented 6 years ago

Updated vim to 8.0.1650_1 That was the latest available in brew in mac at the time of writing. There the ch_open function has the drop parameter and this is not an issue anymore.

I guess, the kite sidebar could warn about this. It looks like the installed vim-plugin does not support 8.0.0071 but the vim sidebar installed it anyways.

jansorg commented 6 years ago

@ahakanbaba Thanks for reporting this issue! We do check the plugin version, the currently required minimum version is VIM 8.0.0027. We'll look at the use of the unsupported value drop.

jansorg commented 6 years ago

@ahakanbaba This issue has been fixed. It will be in the next release this week. The use of the drop parameter was removed. If there's any other issue with the vim plugin, please let us know.

ahakanbaba commented 6 years ago

Similarly to #103 If the fix is part of an open source project, it would be useful to see the change that fixed this.

jansorg commented 6 years ago

@ahakanbaba See #103 . The fix for this issue was to drop the the parameter drop as it was not needed in this particular case.