feat: add parser tiers

Tier 1: Stable
Tier 2: Core (maintained by org members)
Tier 3: Community (maintained by external contributors, to varying
degree)
Tier 4: Unsupported (lacking active maintainer or declared
experimental); skipped in lockfile update and ignored for automatic
install by default
This commit is contained in:
Christian Clason 2023-06-10 17:12:35 +02:00
parent f0a984347c
commit bae77b87b1
7 changed files with 397 additions and 254 deletions

View file

@ -4,7 +4,7 @@ local util = require('nvim-treesitter.util')
-- Load previous lockfile
local filename = require('nvim-treesitter.install').get_package_path('lockfile.json')
-- local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table<string,{revision:string}>]]
local old_lockfile = vim.json.decode(util.read_file(filename)) --[[@as table<string,{revision:string}>]]
---@type table<string,{revision:string}>
local new_lockfile = {}
@ -15,9 +15,10 @@ local jobs = {} --- @type table<string,SystemObj>
-- check for new revisions
for k, p in pairs(parsers) do
if not p.install_info then
if p.tier == 4 then
new_lockfile[k] = old_lockfile[k]
print('Skipping ' .. k)
else
elseif p.install_info then
jobs[k] = vim.system({ 'git', 'ls-remote', p.install_info.url })
end