Skip to content

Regression on parsing vararg param (...) #61

@rmagatti

Description

@rmagatti

Hi 👋

There seems to be a regression I'm not sure is intentional or not when parsing a vararg parameter.

Example:

---DeleteSessionByName deletes sessions given a provided list of paths
---@param ... string[]
function AutoSession.DeleteSessionByName(...)
  local session_paths = {}

  for _, name in ipairs { ... } do
    local escaped_session = Lib.escape_dir(name)
    maybe_disable_autosave(escaped_session)
    local session_path = string.format("%s/%s.vim", AutoSession.get_root_dir(), escaped_session)
    Lib.logger.debug("Deleting session", session_path)
    table.insert(session_paths, session_path)
  end
  AutoSession.DeleteSession(unpack(session_paths))
end

Found in:
https://github.com/rmagatti/auto-session/blob/609c952a50ff1d415d79323364e934eba607fce0/lua/auto-session.lua#L613

Parses to:
https://github.com/rmagatti/auto-session/pull/182/files#diff-27d42bba8f6f0166fc94265a6b8117318675825157368bc590c0da01ba3cba94R145

Instead of:
https://github.com/rmagatti/auto-session/pull/182/files#diff-27d42bba8f6f0166fc94265a6b8117318675825157368bc590c0da01ba3cba94L153

Screenshot 2022-11-16 at 9 46 22 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions