KEMBAR78
[RDY] represent api type String as msgpack type STR. by bfredl · Pull Request #3431 · neovim/neovim · GitHub
Skip to content

Conversation

@bfredl
Copy link
Member

@bfredl bfredl commented Oct 7, 2015

This changes the msgpack representations of strings in nvim from BIN to STR, as disscussed in #1250 (Only affects strings sent from nvim to clients, nvim already accepts both BIN and STR from clients).

Note that only encoding=utf-8 is fully supported, no conversion is done for other &encodings. This is already case when recieving utf-8 STR in requests, where no conversion is done for other encodings. As decided in #1250 remote plugins/GUIs are free to always assume encoding=utf-8.

I have checked python-client (both py2 and py3) and lua-client still works without changes, to the extent that tests still pass (except for unrelated failure in python also on master), but it would be good to check this in more clients before merging this. A client could be made compatible with nvim both before and after this change (by doing the right thing both when BIN and STR is recieved), so they can be updated if needed before this is merged.

ping @myitcv @nhynes @equalsraf @saep @rogual and anyone else implementing an API client/GUI.

@marvim marvim added the RFC label Oct 7, 2015
@myitcv
Copy link
Contributor

myitcv commented Oct 7, 2015

@bfredl - awesome. Will test asap...

@myitcv
Copy link
Contributor

myitcv commented Oct 7, 2015

@bfredl - first thing I've found, MSGPACK requests from neovim to a client still appear to be encoding the method name as BIN. I'll keep looking.

@bfredl
Copy link
Member Author

bfredl commented Oct 7, 2015

@myitcv Thanks, I tried to fix, please try again. I will look into adding tests... There was one test on api metadata that depended on STR/BIN encoding, but none for request/reply.

@bfredl
Copy link
Member Author

bfredl commented Oct 7, 2015

Also noticed ShaDa uses msgpack_rpc_from_string, so ping @ZyX-I .

@bfredl
Copy link
Member Author

bfredl commented Oct 7, 2015

Hmm looks like MessagePack.lua leaves STR and BIN indistinguishable, but we should be able to test it from python3.

equalsraf added a commit to equalsraf/neovim-qt that referenced this pull request Oct 7, 2015
For neovim/neovim#3431 - neovim-qt did not accept the msgpack STR
type (used BIN instead):

- Neovim API signatures with type String
- Msgpack request method names

Now both types are treated the exact same way by the decode functions.

This does not change the current API, we still treat strings as binary
arrays (QByteArray), and we are still sending outgoing strings with type
BIN.
@equalsraf
Copy link
Contributor

Need to patch a couple of things, but otherwise it looks good on my end. I am still sending messages as BIN though (but since Neovim allows both it should be fine).

@nhynes
Copy link
Contributor

nhynes commented Oct 7, 2015

Thinks look fine from JS world. I'll post back if I encounter any issues, though.

@myitcv
Copy link
Contributor

myitcv commented Oct 7, 2015

@bfredl - tested against c35d71f. Working fine (with the tests I have in the Go client). Thanks very much

equalsraf added a commit to equalsraf/neovim-qt that referenced this pull request Oct 7, 2015
For neovim/neovim#3431 - neovim-qt did not accept the msgpack STR
type (used BIN instead):

- Neovim API signatures with type String
- Msgpack request method names

Now both types are treated the exact same way by the decode functions.

This does not change the current API, we still treat strings as binary
arrays (QByteArray), and we are still sending outgoing strings with type
BIN.
@justinmk
Copy link
Member

justinmk commented Oct 8, 2015

@ZyX-I Can you confirm the change to msgpack_rpc_from_string won't disrupt your work on shada?

@saep
Copy link
Contributor

saep commented Oct 8, 2015

I am all for this. The changes to fix the code generation were trivial and it made me refactor the api parser and reduce it's complexity.

👍

@ZyX-I
Copy link
Contributor

ZyX-I commented Oct 8, 2015

@justinmk No, it will. But it is not much of a problem to fix.

@justinmk
Copy link
Member

justinmk commented Oct 8, 2015

@bfredl Can you rebase and mark RDY?

ZyX-I added a commit to ZyX-I/neovim that referenced this pull request Oct 8, 2015
@bfredl bfredl changed the title [RFC] represent api type String as msgpack type STR. [RDY] represent api type String as msgpack type STR. Oct 8, 2015
@bfredl
Copy link
Member Author

bfredl commented Oct 8, 2015

marked as RDY.

@justinmk justinmk merged commit 57d3a2a into neovim:master Oct 8, 2015
@justinmk justinmk removed the RFC label Oct 8, 2015
ZyX-I added a commit to ZyX-I/neovim that referenced this pull request Oct 8, 2015
@myitcv
Copy link
Contributor

myitcv commented Oct 10, 2015

FYI as I've reported in the bot-ci issues list the nightly builds are currently failing and haven't updated for ~5 days.

@bfredl - thanks again, just tested these changes against master and all looks good.

mgraczyk pushed a commit to mgraczyk/neovim that referenced this pull request Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants