aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-12-27 13:22:33 +0100
committerGitHub <noreply@github.com>2022-12-27 13:22:33 +0100
commitd215dae0e0908d464d70e5645f3e2690bd9caf60 (patch)
treee27855c16069b5b9943f68722a06dfdc8b95605b
parent4aec442b5af5a1a7c3aa47626fee09452117575e (diff)
downloadrneovim-d215dae0e0908d464d70e5645f3e2690bd9caf60.tar.gz
rneovim-d215dae0e0908d464d70e5645f3e2690bd9caf60.tar.bz2
rneovim-d215dae0e0908d464d70e5645f3e2690bd9caf60.zip
docs(lua): add `vim.json` (#21538)
-rw-r--r--runtime/doc/lua.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 1459392a81..25d7fa2f35 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -715,6 +715,22 @@ 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*
vim.spell.check({str}) *vim.spell.check()*