diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-08-09 11:06:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 11:06:13 +0200 |
commit | c43c745a14dced87a23227d7be4f1c33d4455193 (patch) | |
tree | 0cd5cf1cbbfa20be7fffbad696ba5ee97181847e /runtime/lua/vim/secure.lua | |
parent | 8afdc1f3867a620c8235b3d3964b019b94657190 (diff) | |
download | rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.tar.gz rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.tar.bz2 rneovim-c43c745a14dced87a23227d7be4f1c33d4455193.zip |
fix(lua): improve annotations for stricter luals diagnostics (#24609)
Problem: luals returns stricter diagnostics with bundled luarc.json
Solution: Improve some function and type annotations:
* use recognized uv.* types
* disable diagnostic for global `vim` in shared.lua
* docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type)
* add type alias for lpeg pattern
* fix return annotation for `vim.secure.trust`
* rename local Range object in vim.version (shadows `Range` in vim.treesitter)
* fix some "missing fields" warnings
* add missing required fields for test functions in eval.lua
* rename lsp meta files for consistency
Diffstat (limited to 'runtime/lua/vim/secure.lua')
-rw-r--r-- | runtime/lua/vim/secure.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/lua/vim/secure.lua b/runtime/lua/vim/secure.lua index 837738c041..893b3e1877 100644 --- a/runtime/lua/vim/secure.lua +++ b/runtime/lua/vim/secure.lua @@ -119,9 +119,8 @@ end --- - path (string|nil): Path to a file to update. Mutually exclusive with {bufnr}. --- Cannot be used when {action} is "allow". --- - bufnr (number|nil): Buffer number to update. Mutually exclusive with {path}. ----@return (boolean, string) success, msg: ---- - true and full path of target file if operation was successful ---- - false and error message on failure +---@return boolean success true if operation was successful +---@return string msg full path if operation was successful, else error message function M.trust(opts) vim.validate({ path = { opts.path, 's', true }, |