Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rmagatti opened this issue Nov 17, 2022 · 3 comments · Fixed by #62
Closed

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

rmagatti opened this issue Nov 17, 2022 · 3 comments · Fixed by #62
Labels
enhancement Improvement neeeded

Comments

@rmagatti
Copy link

rmagatti commented Nov 17, 2022

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

@numToStr
Copy link
Owner

Ohh, I completely forgot to parse vararg in #47. Thanks for reporting the bug! I'll fix it.

@numToStr numToStr added the enhancement Improvement neeeded label Nov 17, 2022
numToStr added a commit that referenced this issue Nov 17, 2022
@rmagatti
Copy link
Author

Oh damn, that was fast! I'm assuming I should wait for a .tgz version of the lib to try it out? Thanks again!

@numToStr
Copy link
Owner

numToStr commented Nov 17, 2022

Yeah, I'll release next version in couple of days as I am thinking of squeezing #58 in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement neeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants