aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/secure.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-02-27 15:20:32 +0000
committerLewis Russell <me@lewisr.dev>2024-03-01 23:02:18 +0000
commita5fe8f59d98398d04bed8586cee73864bbcdde92 (patch)
tree9dd8086edc1e572ba1fddd03df17918dcd76a72e /runtime/lua/vim/secure.lua
parent813dd36b72979dfd05479eb6402b9becc0faea29 (diff)
downloadrneovim-a5fe8f59d98398d04bed8586cee73864bbcdde92.tar.gz
rneovim-a5fe8f59d98398d04bed8586cee73864bbcdde92.tar.bz2
rneovim-a5fe8f59d98398d04bed8586cee73864bbcdde92.zip
docs: improve/add documentation of Lua types
- Added `@inlinedoc` so single use Lua types can be inlined into the functions docs. E.g. ```lua --- @class myopts --- @inlinedoc --- --- Documentation for some field --- @field somefield integer --- @param opts myOpts function foo(opts) end ``` Will be rendered as ``` foo(opts) Parameters: - {opts} (table) Object with the fields: - somefield (integer) Documentation for some field ``` - Marked many classes with with `@nodoc` or `(private)`. We can eventually introduce these when we want to.
Diffstat (limited to 'runtime/lua/vim/secure.lua')
-rw-r--r--runtime/lua/vim/secure.lua25
1 files changed, 14 insertions, 11 deletions
diff --git a/runtime/lua/vim/secure.lua b/runtime/lua/vim/secure.lua
index d29c356af3..3992eef78a 100644
--- a/runtime/lua/vim/secure.lua
+++ b/runtime/lua/vim/secure.lua
@@ -108,22 +108,25 @@ function M.read(path)
return contents
end
----@class vim.trust.opts
----@field action string
----@field path? string
----@field bufnr? integer
+--- @class vim.trust.opts
+--- @inlinedoc
+---
+--- - `'allow'` to add a file to the trust database and trust it,
+--- - `'deny'` to add a file to the trust database and deny it,
+--- - `'remove'` to remove file from the trust database
+--- @field action 'allow'|'deny'|'remove'
+---
+--- Path to a file to update. Mutually exclusive with {bufnr}.
+--- Cannot be used when {action} is "allow".
+--- @field path? string
+--- Buffer number to update. Mutually exclusive with {path}.
+--- @field bufnr? integer
--- Manage the trust database.
---
--- The trust database is located at |$XDG_STATE_HOME|/nvim/trust.
---
----@param opts (table):
---- - action (string): "allow" to add a file to the trust database and trust it,
---- "deny" to add a file to the trust database and deny it,
---- "remove" to remove file from the trust database
---- - 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}.
+---@param opts? vim.trust.opts
---@return boolean success true if operation was successful
---@return string msg full path if operation was successful, else error message
function M.trust(opts)