Skip to content

string.find annotation of return value is not precise enough #2179

@ochaton

Description

@ochaton

From Lua Reference Manual https://www.lua.org/manual/5.3/manual.html#pdf-string.find

Return value is {start, end} or nil (when not found). It is better to add question mark to annotation of return value for all 5.1-5.4 (including JIT).

Existing annotation in LuaLangServer 3.6.22 is misleading: developers think that in case when pattern or substring is not found string.find returns -1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions