feat: allow a custom revision in install_info

This commit is contained in:
Lewis Russell 2023-09-11 11:20:09 +01:00 committed by Christian Clason
parent 3966b8808b
commit 1bec16362f
2 changed files with 6 additions and 0 deletions

View file

@ -81,6 +81,11 @@ end
---@param lang string
---@return string?
local function get_target_revision(lang)
local info = get_parser_install_info(lang)
if info and info.revision then
return info.revision
end
if #lockfile == 0 then
local filename = M.get_package_path('lockfile.json')
lockfile = vim.json.decode(util.read_file(filename)) --[[@as table<string, LockfileInfo>]]

View file

@ -1,6 +1,7 @@
---@class InstallInfo
---@field url string
---@field branch string|nil
---@field revision string|nil Used to override lockfile revision
---@field files string[]
---@field generate_requires_npm boolean|nil
---@field requires_generate_from_grammar boolean|nil