neovim/test/functional/lua
Justin M. Keyes 8d4a53fe6e
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: cc76ae3abe
- `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()`
2023-06-21 01:10:32 -07:00
..
api_spec.lua vim-patch:8.2.2857: Vim9: exception in ISN_INSTR caught at wrong level (#23131) 2023-04-16 18:27:33 +08:00
buffer_updates_spec.lua fix(spell): splice extmarks on :spellrepall (#23929) 2023-06-06 10:32:30 +08:00
command_line_completion_spec.lua refactor(options): deprecate nvim[_buf|_win]_[gs]et_option 2023-05-21 15:14:01 +06:00
commands_spec.lua fix(excmd): append original command to error message 2023-05-05 10:43:28 +08:00
diagnostic_spec.lua feat(diagnostic): specify diagnostic virtual text prefix as a function 2023-04-17 12:53:34 +01:00
ffi_spec.lua refactor: remove char_u (#22829) 2023-04-02 16:11:42 +08:00
filetype_spec.lua test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value 2023-05-22 13:02:07 +06:00
fs_spec.lua fix(fs): make normalize() work with '/' path (#24047) 2023-06-18 06:49:33 -05:00
help_spec.lua test(help): drop treesitter parse error to 0 2023-02-23 10:24:15 +01:00
highlight_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
inspector_spec.lua refactor(options): deprecate nvim[_buf|_win]_[gs]et_option 2023-05-21 15:14:01 +06:00
iter_spec.lua feat(lua): use callable table as iterator in vim.iter (#23957) 2023-06-10 20:33:23 +02:00
json_spec.lua fix(vim.json)!: remove global options, "null", "array_mt" #24070 2023-06-21 01:10:32 -07:00
loader_spec.lua fix(loader): reset hashes when running the loader 2023-04-13 17:34:47 +01:00
loop_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
luaeval_spec.lua test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value 2023-05-22 13:02:07 +06:00
mpack_spec.lua fix(vim.mpack): rename pack/unpack => encode/decode #16175 2021-10-30 06:59:59 -07:00
overrides_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
runtime_spec.lua fix(colorscheme): try .lua files in 'rtp' before .vim files in 'pp' (#23727) 2023-05-23 16:12:16 +08:00
secure_spec.lua test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value 2023-05-22 13:02:07 +06:00
spell_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00
system_spec.lua feat(lua): add vim.system() 2023-06-07 13:52:23 +01:00
thread_spec.lua feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
ui_event_spec.lua test: make expect_unchanged() less confusing (#22255) 2023-02-15 07:26:55 +08:00
ui_spec.lua test(lua/ui_spec): fix Ctrl-C test flakiness (#21039) 2022-11-13 08:16:06 +08:00
uri_spec.lua test: simplify platform detection (#21020) 2022-11-22 08:13:30 +08:00
version_spec.lua feat: tostring(vim.version()) 2023-06-12 01:14:33 +02:00
vim_spec.lua feat(lua): add ringbuffer (#22894) 2023-06-08 12:11:24 +02:00
watch_spec.lua perf(lsp): reduce polling handles for workspace/didChangeWatchedFiles (#23500) 2023-06-14 12:40:11 +02:00
xdiff_spec.lua feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00