commit a75b09019f51d740f0890d881c90e140581f13e8
parent 0e8e4a07f5150f363508b2f010f92688d3428a6a
Author: phanium <91544758+phanen@users.noreply.github.com>
Date: Mon, 17 Feb 2025 05:33:56 +0800
docs: stdpath() type #32480
Diffstat:
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua
@@ -9351,6 +9351,14 @@ function vim.fn.stdioopen(opts) end
--- @return string|string[]
function vim.fn.stdpath(what) end
+--- @param what 'cache'|'config'|'data'|'log'|'run'|'state'
+--- @return string
+function vim.fn.stdpath(what) end
+
+--- @param what 'config_dirs'|'data_dirs'
+--- @return string[]
+function vim.fn.stdpath(what) end
+
--- Convert String {string} to a Float. This mostly works the
--- same as when using a floating point number in an expression,
--- see |floating-point-format|. But it's a bit more permissive.
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
@@ -11250,6 +11250,20 @@ M.funcs = {
returns = 'string|string[]',
signature = 'stdpath({what})',
},
+ stdpath__1 = {
+ args = 1,
+ fast = true,
+ name = 'stdpath',
+ params = { { 'what', "'cache'|'config'|'data'|'log'|'run'|'state'" } },
+ returns = 'string',
+ },
+ stdpath__2 = {
+ args = 1,
+ fast = true,
+ name = 'stdpath',
+ params = { { 'what', "'config_dirs'|'data_dirs'" } },
+ returns = 'string[]',
+ },
str2float = {
args = 1,
base = 1,