docs(eval): fix fn.strchar types #37737

Problem: The following strchar functions have incorrect types:

strcharlen() - Currently any. Always returns an integer, including on
error

strcharpart() - The skipcc annotation does not specify that 0 and 1 are
valid. These inputs are required for vimscript usage. The current
return type is any, even though the function returns an empty string
on error

strchars() - The skipcc annotation does not specify that 0 and 1 are
valid

Solution: Update the problem types.
This commit is contained in:
Mike J McGuirk
2026-02-08 08:07:49 -05:00
committed by GitHub
parent 6771b10b88
commit 6cb3254c2f
3 changed files with 12 additions and 10 deletions

View File

@@ -11532,6 +11532,7 @@ M.funcs = {
]=],
name = 'strcharlen',
params = { { 'string', 'string' } },
returns = 'integer',
signature = 'strcharlen({string})',
},
strcharpart = {
@@ -11559,8 +11560,9 @@ M.funcs = {
{ 'src', 'string' },
{ 'start', 'integer' },
{ 'len', 'integer' },
{ 'skipcc', 'boolean' },
{ 'skipcc', '0|1|boolean' },
},
returns = 'string',
signature = 'strcharpart({src}, {start} [, {len} [, {skipcc}]])',
},
strchars = {
@@ -11596,7 +11598,7 @@ M.funcs = {
<
]=],
name = 'strchars',
params = { { 'string', 'string' }, { 'skipcc', 'boolean' } },
params = { { 'string', 'string' }, { 'skipcc', '0|1|boolean' } },
returns = 'integer',
signature = 'strchars({string} [, {skipcc}])',
},