neovim/test/functional/lua
Justin M. Keyes 40ce857797
fix(vim.ui)!: change open() to return result|nil, errmsg|nil #28612
reverts e0d92b9cc2 #28502

Problem:
`vim.ui.open()` has a `pcall()` like signature, under the assumption
that this is the Lua idiom for returning result-or-error. However, the
`result|nil, errmsg|nil` pattern:
- has precedent in:
  - `io.open`
  - `vim.uv` (`:help luv-error-handling`)
- has these advantages:
  - Can be used with `assert()`:
    ```
    local result, err = assert(foobar())
    ```
  - Allows LuaLS to infer the type of `result`:
    ```
    local result, err = foobar()
    if err then
      ...
    elseif result then
      ...
    end
    ```

Solution:
- Revert to the `result|nil, errmsg|nil` pattern.
- Document the pattern in our guidelines.
2024-05-03 03:20:03 -07:00
..
api_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
base64_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
buffer_updates_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
command_line_completion_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
commands_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
comment_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
diagnostic_spec.lua feat(diagnostic): revert default behaviour of goto_next/prev() 2024-04-30 13:39:27 +01:00
ffi_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
filetype_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
fs_spec.lua feat(fs): add vim.fs.root (#28477) 2024-04-24 21:43:46 -05:00
glob_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
highlight_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
inspector_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
iter_spec.lua refactor(vim.iter)!: rename xxback() => rxx() #28503 2024-04-26 08:43:29 -07:00
json_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
loader_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
loop_spec.lua fix(lua): vim.fn.has('nvim-0.10') in fast context, used by vim.deprecate 2024-04-25 08:37:18 +02:00
luaeval_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
mpack_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
overrides_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
runtime_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
secure_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
snippet_spec.lua fix(lsp): redundant vim.snippet.jumpable #28560 2024-04-29 13:45:53 -07:00
spell_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
system_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
text_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
thread_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
ui_event_spec.lua fix(ui): avoid recursiveness and invalid memory access #28578 2024-05-01 13:51:06 -07:00
ui_spec.lua fix(vim.ui)!: change open() to return result|nil, errmsg|nil #28612 2024-05-03 03:20:03 -07:00
uri_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
version_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
vim_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
watch_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
xdiff_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00