mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: allow a custom revision in install_info
This commit is contained in:
parent
3966b8808b
commit
1bec16362f
2 changed files with 6 additions and 0 deletions
|
|
@ -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>]]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue