diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2023-06-21 01:10:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-21 01:10:32 -0700 |
commit | 8d4a53fe6e20652946948170f2436ec520f9bdfe (patch) | |
tree | 6a25d79025a92bffc400d8766ea536bb12585911 /runtime/lua/man.lua | |
parent | e42fdaad21a87d0aaf882f1ad836b00d2eccd21a (diff) | |
download | rneovim-8d4a53fe6e20652946948170f2436ec520f9bdfe.tar.gz rneovim-8d4a53fe6e20652946948170f2436ec520f9bdfe.tar.bz2 rneovim-8d4a53fe6e20652946948170f2436ec520f9bdfe.zip |
fix(vim.json)!: remove global options, "null", "array_mt" #24070
Problem:
- `vim.json` exposes various global options which:
- affect all Nvim Lua plugins (especially the LSP client)
- are undocumented and untested
- can cause confusing problems such as: https://github.com/codota/tabnine-nvim/commit/cc76ae3abe2f129d44b5a8edee2529e0ee0dcf69
- `vim.json` exposes redundant mechanisms:
- `vim.json.null` is redundant with `vim.NIL`.
- `array_mt` is redundant because Nvim uses a metatable
(`vim.empty_dict()`) for empty dict instead, which `vim.json` is
configured to use by default (see `as_empty_dict`).
Example:
```
:lua vim.print(vim.json.decode('{"bar":[],"foo":{}}'))
--> { bar = {}, foo = vim.empty_dict() }
```
Thus we don't need to also decorate empty arrays with `array_mt`.
Solution:
Remove the functions from the public vim.json interface.
Comment-out the implementation code to minimize drift from upstream.
TODO:
- Expose the options as arguments to `vim.json.new()`
Diffstat (limited to 'runtime/lua/man.lua')
0 files changed, 0 insertions, 0 deletions