mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
docs(lua): add vim.json
(#21538)
This commit is contained in:
parent
4aec442b5a
commit
d215dae0e0
@ -714,6 +714,22 @@ vim.mpack.encode({obj}) *vim.mpack.encode*
|
||||
vim.mpack.decode({str}) *vim.mpack.decode*
|
||||
Decodes (or "unpacks") the msgpack-encoded {str} to a Lua object.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
VIM.JSON *lua-json*
|
||||
|
||||
The *vim.json* module provides encoding and decoding of Lua objects to and
|
||||
from JSON-encoded strings. Supports |vim.NIL| and |vim.empty_dict()|.
|
||||
|
||||
vim.json.encode({obj}) *vim.json.encode*
|
||||
Encodes (or "packs") Lua object {obj} as JSON in a Lua string.
|
||||
|
||||
vim.json.decode({str}[, {opts}]) *vim.json.decode*
|
||||
Decodes (or "unpacks") the JSON-encoded {str} to a Lua object.
|
||||
|
||||
{opts} is a table with the key `luanil = { object: bool, array: bool }`
|
||||
that controls whether `null` in JSON objects or arrays should be converted
|
||||
to Lua `nil` instead of `vim.NIL`.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
VIM.SPELL *lua-spell*
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user