mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 10:20:11 -04:00
fix: install dependencies
This commit is contained in:
parent
008cc677d2
commit
ea192c36ad
8 changed files with 205 additions and 131 deletions
|
|
@ -51,12 +51,13 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ ` | | | @amaanq
|
[doxygen](https://github.com/amaanq/tree-sitter-doxygen) | stable | `H IJ ` | | | @amaanq
|
||||||
[dtd](https://github.com/ObserverOfTime/tree-sitter-xml) | stable | `HF J ` | | | @ObserverOfTime
|
[dtd](https://github.com/ObserverOfTime/tree-sitter-xml) | stable | `HF J ` | | | @ObserverOfTime
|
||||||
[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H ` | | | @RubixDev
|
[ebnf](https://github.com/RubixDev/ebnf) | unstable | `H ` | | | @RubixDev
|
||||||
|
ecma (queries only)[^ecma] | | `HFIJL` | | | @steelsojka
|
||||||
[eex](https://github.com/connorlay/tree-sitter-eex) | | `H J ` | | | @connorlay
|
[eex](https://github.com/connorlay/tree-sitter-eex) | | `H J ` | | | @connorlay
|
||||||
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | | `HFIJL` | | | @connorlay
|
[elixir](https://github.com/elixir-lang/tree-sitter-elixir) | | `HFIJL` | | | @connorlay
|
||||||
[elm](https://github.com/elm-tooling/tree-sitter-elm) | | `H J ` | | | @zweimach
|
[elm](https://github.com/elm-tooling/tree-sitter-elm) | | `H J ` | | | @zweimach
|
||||||
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | | `HFIJL` | | | @glapa-grossklag, @amaanq
|
[elsa](https://github.com/glapa-grossklag/tree-sitter-elsa) | | `HFIJL` | | | @glapa-grossklag, @amaanq
|
||||||
[elvish](https://github.com/elves/tree-sitter-elvish) | | `H J ` | | | @elves
|
[elvish](https://github.com/elves/tree-sitter-elvish) | | `H J ` | | | @elves
|
||||||
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | | `H J ` | | |
|
[embedded_template](https://github.com/tree-sitter/tree-sitter-embedded-template) | unstable | `H J ` | | |
|
||||||
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | | `HF ` | | | @filmor
|
[erlang](https://github.com/WhatsApp/tree-sitter-erlang) | | `HF ` | | | @filmor
|
||||||
[fennel](https://github.com/travonted/tree-sitter-fennel) | | `HF JL` | | | @TravonteD
|
[fennel](https://github.com/travonted/tree-sitter-fennel) | | `HF JL` | | | @TravonteD
|
||||||
[firrtl](https://github.com/amaanq/tree-sitter-firrtl) | | `HFIJL` | | | @amaanq
|
[firrtl](https://github.com/amaanq/tree-sitter-firrtl) | | `HFIJL` | | | @amaanq
|
||||||
|
|
@ -84,9 +85,9 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[gpg](https://github.com/ObserverOfTime/tree-sitter-gpg-config) | stable | `H J ` | | | @ObserverOfTime
|
[gpg](https://github.com/ObserverOfTime/tree-sitter-gpg-config) | stable | `H J ` | | | @ObserverOfTime
|
||||||
[graphql](https://github.com/bkegley/tree-sitter-graphql) | | `H IJ ` | | | @bkegley
|
[graphql](https://github.com/bkegley/tree-sitter-graphql) | | `H IJ ` | | | @bkegley
|
||||||
[groovy](https://github.com/Decodetalkers/tree-sitter-groovy) | community | `H J ` | | | @Decodetalkers
|
[groovy](https://github.com/Decodetalkers/tree-sitter-groovy) | community | `H J ` | | | @Decodetalkers
|
||||||
[hack](https://github.com/slackhq/tree-sitter-hack) | | `H ` | | |
|
[hack](https://github.com/slackhq/tree-sitter-hack) | unstable | `H ` | | |
|
||||||
[hare](https://github.com/amaanq/tree-sitter-hare) | | `HFIJL` | | | @amaanq
|
[hare](https://github.com/amaanq/tree-sitter-hare) | | `HFIJL` | | | @amaanq
|
||||||
[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | | `HF J ` | | |
|
[haskell](https://github.com/tree-sitter/tree-sitter-haskell) | unstable | `HF J ` | | |
|
||||||
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | | `HF ` | | | @lykahb
|
[haskell_persistent](https://github.com/MercuryTechnologies/tree-sitter-haskell-persistent) | | `HF ` | | | @lykahb
|
||||||
[hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann
|
[hcl](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann
|
||||||
[heex](https://github.com/connorlay/tree-sitter-heex) | | `HFIJL` | | | @connorlay
|
[heex](https://github.com/connorlay/tree-sitter-heex) | | `HFIJL` | | | @connorlay
|
||||||
|
|
@ -95,6 +96,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `H J ` | | ✓ | @antosha417
|
[hocon](https://github.com/antosha417/tree-sitter-hocon) | | `H J ` | | ✓ | @antosha417
|
||||||
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unstable | `HF L` | | | @urbit-pilled
|
[hoon](https://github.com/urbit-pilled/tree-sitter-hoon) | unstable | `HF L` | | | @urbit-pilled
|
||||||
[html](https://github.com/tree-sitter/tree-sitter-html) | | `HFIJL` | | | @TravonteD
|
[html](https://github.com/tree-sitter/tree-sitter-html) | | `HFIJL` | | | @TravonteD
|
||||||
|
html_tags (queries only)[^html_tags] | | `H IJ ` | | | @TravonteD
|
||||||
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | | | @ObserverOfTime
|
[htmldjango](https://github.com/interdependence/tree-sitter-htmldjango) | unstable | `HFIJ ` | | | @ObserverOfTime
|
||||||
[http](https://github.com/rest-nvim/tree-sitter-http) | | `H J ` | | ✓ | @amaanq
|
[http](https://github.com/rest-nvim/tree-sitter-http) | | `H J ` | | ✓ | @amaanq
|
||||||
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj
|
[hurl](https://github.com/pfeiferj/tree-sitter-hurl) | community | `HFIJ ` | | | @pfeiferj
|
||||||
|
|
@ -107,8 +109,9 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | | `H ` | | | @steelsojka
|
[jsdoc](https://github.com/tree-sitter/tree-sitter-jsdoc) | | `H ` | | | @steelsojka
|
||||||
[json](https://github.com/tree-sitter/tree-sitter-json) | | `HFI L` | | | @steelsojka
|
[json](https://github.com/tree-sitter/tree-sitter-json) | | `HFI L` | | | @steelsojka
|
||||||
[json5](https://github.com/Joakker/tree-sitter-json5) | | `H J ` | | | @Joakker
|
[json5](https://github.com/Joakker/tree-sitter-json5) | | `H J ` | | | @Joakker
|
||||||
[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git)[^jsonc] | | `HFIJL` | | ✓ | @WhyNotHugo
|
[jsonc](https://gitlab.com/WhyNotHugo/tree-sitter-jsonc.git) | | `HFIJL` | | ✓ | @WhyNotHugo
|
||||||
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | | `HF L` | | | @nawordar
|
[jsonnet](https://github.com/sourcegraph/tree-sitter-jsonnet) | | `HF L` | | | @nawordar
|
||||||
|
jsx (queries only)[^jsx] | | `HFIJ ` | | | @steelsojka
|
||||||
[julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJL` | | | @theHamsta
|
[julia](https://github.com/tree-sitter/tree-sitter-julia) | community | `HFIJL` | | | @theHamsta
|
||||||
[kconfig](https://github.com/amaanq/tree-sitter-kconfig) | stable | `HFIJL` | | | @amaanq
|
[kconfig](https://github.com/amaanq/tree-sitter-kconfig) | stable | `HFIJL` | | | @amaanq
|
||||||
[kdl](https://github.com/amaanq/tree-sitter-kdl) | | `HFIJL` | | | @amaanq
|
[kdl](https://github.com/amaanq/tree-sitter-kdl) | | `HFIJL` | | | @amaanq
|
||||||
|
|
@ -130,7 +133,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unstable | `H ` | | |
|
[mermaid](https://github.com/monaqa/tree-sitter-mermaid) | unstable | `H ` | | |
|
||||||
[meson](https://github.com/Decodetalkers/tree-sitter-meson) | | `HF J ` | | | @Decodetalkers
|
[meson](https://github.com/Decodetalkers/tree-sitter-meson) | | `HF J ` | | | @Decodetalkers
|
||||||
[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H L` | ✓ | | @artagnon
|
[mlir](https://github.com/artagnon/tree-sitter-mlir) | unstable | `H L` | ✓ | | @artagnon
|
||||||
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | | `H I ` | | |
|
[nickel](https://github.com/nickel-lang/tree-sitter-nickel) | unstable | `H I ` | | |
|
||||||
[ninja](https://github.com/alemuller/tree-sitter-ninja) | | `HFI ` | | | @alemuller
|
[ninja](https://github.com/alemuller/tree-sitter-ninja) | | `HFI ` | | | @alemuller
|
||||||
[nix](https://github.com/cstrahan/tree-sitter-nix) | | `HF JL` | | | @leo60228
|
[nix](https://github.com/cstrahan/tree-sitter-nix) | | `HF JL` | | | @leo60228
|
||||||
[norg](https://github.com/nvim-neorg/tree-sitter-norg) | unstable | ` ` | | | @JoeyGrajciar, @vhyrro
|
[norg](https://github.com/nvim-neorg/tree-sitter-norg) | unstable | ` ` | | | @JoeyGrajciar, @vhyrro
|
||||||
|
|
@ -140,7 +143,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | | `HFIJL` | | | @undu
|
[ocaml_interface](https://github.com/tree-sitter/tree-sitter-ocaml) | | `HFIJL` | | | @undu
|
||||||
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | | `H J ` | ✓ | | @undu
|
[ocamllex](https://github.com/atom-ocaml/tree-sitter-ocamllex) | | `H J ` | ✓ | | @undu
|
||||||
[odin](https://github.com/amaanq/tree-sitter-odin) | | `HFIJL` | | | @amaanq
|
[odin](https://github.com/amaanq/tree-sitter-odin) | | `HFIJL` | | | @amaanq
|
||||||
[org](https://github.com/milisims/tree-sitter-org) | | ` ` | | |
|
[org](https://github.com/milisims/tree-sitter-org) | unstable | ` ` | | |
|
||||||
[pascal](https://github.com/Isopod/tree-sitter-pascal.git) | | `HFIJL` | | | @Isopod
|
[pascal](https://github.com/Isopod/tree-sitter-pascal.git) | | `HFIJL` | | | @Isopod
|
||||||
[passwd](https://github.com/ath3/tree-sitter-passwd) | | `H ` | | | @amaanq
|
[passwd](https://github.com/ath3/tree-sitter-passwd) | | `H ` | | | @amaanq
|
||||||
[pem](https://github.com/ObserverOfTime/tree-sitter-pem) | stable | `HF J ` | | | @ObserverOfTime
|
[pem](https://github.com/ObserverOfTime/tree-sitter-pem) | stable | `HF J ` | | | @ObserverOfTime
|
||||||
|
|
@ -180,7 +183,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[scala](https://github.com/tree-sitter/tree-sitter-scala) | | `HF JL` | | | @stevanmilic
|
[scala](https://github.com/tree-sitter/tree-sitter-scala) | | `HF JL` | | | @stevanmilic
|
||||||
[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | community | `H J ` | ✓ | | @WhyNotHugo
|
[scfg](https://git.sr.ht/~rockorager/tree-sitter-scfg) | community | `H J ` | ✓ | | @WhyNotHugo
|
||||||
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unstable | `HF J ` | | |
|
[scheme](https://github.com/6cdh/tree-sitter-scheme) | unstable | `HF J ` | | |
|
||||||
[scss](https://github.com/serenadeai/tree-sitter-scss) | | `HFI ` | | | @elianiva
|
[scss](https://github.com/serenadeai/tree-sitter-scss) | community | `HFI ` | | | @elianiva
|
||||||
[slint](https://github.com/jrmoulton/tree-sitter-slint) | unstable | `H I ` | | | @jrmoulton
|
[slint](https://github.com/jrmoulton/tree-sitter-slint) | unstable | `H I ` | | | @jrmoulton
|
||||||
[smali](https://git.sr.ht/~yotam/tree-sitter-smali) | | `HFIJL` | | | @amaanq
|
[smali](https://git.sr.ht/~yotam/tree-sitter-smali) | | `HFIJL` | | | @amaanq
|
||||||
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H ` | | | @amaanq, @keynmol
|
[smithy](https://github.com/indoorvivants/tree-sitter-smithy) | | `H ` | | | @amaanq, @keynmol
|
||||||
|
|
@ -199,7 +202,7 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[t32](https://gitlab.com/xasc/tree-sitter-t32.git) | community | `HFIJL` | | | @xasc
|
[t32](https://gitlab.com/xasc/tree-sitter-t32.git) | community | `HFIJL` | | | @xasc
|
||||||
[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | | `HFIJL` | | | @amaanq
|
[tablegen](https://github.com/amaanq/tree-sitter-tablegen) | | `HFIJL` | | | @amaanq
|
||||||
[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJL` | ✓ | | @euclidianAce
|
[teal](https://github.com/euclidianAce/tree-sitter-teal) | | `HFIJL` | ✓ | | @euclidianAce
|
||||||
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | | `HFIJ ` | | | @MichaHoffmann
|
[terraform](https://github.com/MichaHoffmann/tree-sitter-hcl) | community | `HFIJ ` | | | @MichaHoffmann
|
||||||
[thrift](https://github.com/duskmoon314/tree-sitter-thrift) | | `HFIJL` | | | @amaanq, @duskmoon314
|
[thrift](https://github.com/duskmoon314/tree-sitter-thrift) | | `HFIJL` | | | @amaanq, @duskmoon314
|
||||||
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | | `HFIJL` | | | @ambroisie
|
[tiger](https://github.com/ambroisie/tree-sitter-tiger) | | `HFIJL` | | | @ambroisie
|
||||||
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | | `HF JL` | | | @ahelwer, @susliko
|
[tlaplus](https://github.com/tlaplus-community/tree-sitter-tlaplus) | | `HF JL` | | | @ahelwer, @susliko
|
||||||
|
|
@ -229,11 +232,13 @@ Language | Tier | Queries | CLI | NPM | Maintainer
|
||||||
[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ ` | | | @Hubro
|
[yang](https://github.com/Hubro/tree-sitter-yang) | | `HFIJ ` | | | @Hubro
|
||||||
[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJL` | | | @Philipp-M, @amaanq
|
[yuck](https://github.com/Philipp-M/tree-sitter-yuck) | | `HFIJL` | | | @Philipp-M, @amaanq
|
||||||
[zig](https://github.com/maxxnino/tree-sitter-zig) | | `HFIJL` | | | @maxxnino
|
[zig](https://github.com/maxxnino/tree-sitter-zig) | | `HFIJL` | | | @maxxnino
|
||||||
|
[^ecma]: queries required by javascript, typescript, tsx, qmljs
|
||||||
[^gdscript]: Godot
|
[^gdscript]: Godot
|
||||||
[^git_config]: git_config
|
[^git_config]: git_config
|
||||||
[^glimmer]: Glimmer and Ember
|
[^glimmer]: Glimmer and Ember
|
||||||
[^godot_resource]: Godot Resources
|
[^godot_resource]: Godot Resources
|
||||||
[^jsonc]: JSON with comments
|
[^html_tags]: queries required by html, astro, vue, svelte
|
||||||
|
[^jsx]: queries required by javascript, tsx
|
||||||
[^luap]: Lua patterns
|
[^luap]: Lua patterns
|
||||||
[^markdown]: basic highlighting
|
[^markdown]: basic highlighting
|
||||||
[^markdown_inline]: needed for full highlighting
|
[^markdown_inline]: needed for full highlighting
|
||||||
|
|
|
||||||
7
TODO.md
7
TODO.md
|
|
@ -5,14 +5,9 @@ This document lists the planned and finished changes in this rewrite towards [Nv
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
- [ ] **`query_predicates.lua`:** upstream/remove
|
- [ ] **`query_predicates.lua`:** upstream/remove
|
||||||
- [ ] **`parsers.lua`:** add dependencies (and "query-only" langs like ecma, jsx, html_tags, ...)
|
|
||||||
- [ ] **`parsers.lua`:** assign tiers
|
- [ ] **`parsers.lua`:** assign tiers
|
||||||
- [ ] **`parsers.lua`:** modularize?
|
- [ ] **`parsers.lua`:** modularize?
|
||||||
- [ ] **`install.lua`:** simplify compilation:
|
- [ ] **`install.lua`:** drop norg (and makefile); document c++11 requirement
|
||||||
- hardcode one compiler + args per platform
|
|
||||||
- provide `install.compile_command` for overriding (function that takes files, ...?)
|
|
||||||
- allow using repo makefile (norg!)?
|
|
||||||
- ...or switch to makefile completely?
|
|
||||||
- [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`?
|
- [ ] **`locals.lua`:** move to `nvim-treesitter-refactor`?
|
||||||
- [ ] **update-lockfile:** allow specifying version in addition to commit hash (for Tier 1)
|
- [ ] **update-lockfile:** allow specifying version in addition to commit hash (for Tier 1)
|
||||||
- [ ] **update-lockfile:** one commit per parser/tier?
|
- [ ] **update-lockfile:** one commit per parser/tier?
|
||||||
|
|
|
||||||
|
|
@ -74,12 +74,11 @@ end
|
||||||
|
|
||||||
---@return string[]
|
---@return string[]
|
||||||
function M.installed_parsers()
|
function M.installed_parsers()
|
||||||
local install_dir = M.get_install_dir('parser')
|
local install_dir = M.get_install_dir('queries')
|
||||||
|
|
||||||
local installed = {} --- @type string[]
|
local installed = {} --- @type string[]
|
||||||
for f in vim.fs.dir(install_dir) do
|
for f in vim.fs.dir(install_dir) do
|
||||||
local lang = assert(f:match('(.*)%..*'))
|
installed[#installed + 1] = f
|
||||||
installed[#installed + 1] = lang
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return installed
|
return installed
|
||||||
|
|
@ -139,6 +138,14 @@ function M.norm_languages(languages, skip)
|
||||||
end, languages) --[[@as string[] ]]
|
end, languages) --[[@as string[] ]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not (skip and skip.dependencies) then
|
||||||
|
for _, lang in pairs(languages) do
|
||||||
|
if parsers.configs[lang].requires then
|
||||||
|
vim.list_extend(languages, parsers.configs[lang].requires)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return languages
|
return languages
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
local install = require('nvim-treesitter.install')
|
local install = require('nvim-treesitter.install')
|
||||||
|
local parsers = require('nvim-treesitter.parsers')
|
||||||
local config = require('nvim-treesitter.config')
|
local config = require('nvim-treesitter.config')
|
||||||
local util = require('nvim-treesitter.util')
|
local util = require('nvim-treesitter.util')
|
||||||
local tsq = vim.treesitter.query
|
local tsq = vim.treesitter.query
|
||||||
|
|
@ -123,14 +124,25 @@ function M.check()
|
||||||
-- Installation dependency checks
|
-- Installation dependency checks
|
||||||
install_health()
|
install_health()
|
||||||
-- Parser installation checks
|
-- Parser installation checks
|
||||||
|
local languages = config.installed_parsers()
|
||||||
local parser_installation = { 'Parser/Features' .. string.rep(' ', 9) .. 'H L F I J' }
|
local parser_installation = { 'Parser/Features' .. string.rep(' ', 9) .. 'H L F I J' }
|
||||||
for _, parser_name in pairs(config.installed_parsers()) do
|
for _, lang in pairs(languages) do
|
||||||
local out = ' - ' .. parser_name .. string.rep(' ', 20 - #parser_name)
|
local parser = parsers.configs[lang]
|
||||||
for _, query_group in pairs(M.bundled_queries) do
|
local out = ' - ' .. lang .. string.rep(' ', 20 - #lang)
|
||||||
local status, err = query_status(parser_name, query_group)
|
if parser.install_info then
|
||||||
out = out .. status .. ' '
|
for _, query_group in pairs(M.bundled_queries) do
|
||||||
if err then
|
local status, err = query_status(lang, query_group)
|
||||||
table.insert(error_collection, { parser_name, query_group, err })
|
out = out .. status .. ' '
|
||||||
|
if err then
|
||||||
|
table.insert(error_collection, { lang, query_group, err })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if parser.requires then
|
||||||
|
for _, p in pairs(parser.requires) do
|
||||||
|
if not vim.list_contains(languages, p) then
|
||||||
|
table.insert(error_collection, { lang, 'queries', 'dependency ' .. p .. ' missing' })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(parser_installation, vim.fn.trim(out, ' ', 2))
|
table.insert(parser_installation, vim.fn.trim(out, ' ', 2))
|
||||||
|
|
|
||||||
|
|
@ -446,74 +446,76 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local cc = M.select_executable(M.compilers)
|
local logger = log.new('install/' .. lang)
|
||||||
if not cc then
|
local err
|
||||||
cc_err()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local repo = get_parser_install_info(lang)
|
local repo = get_parser_install_info(lang)
|
||||||
|
if repo then
|
||||||
local project_name = 'tree-sitter-' .. lang
|
local cc = M.select_executable(M.compilers)
|
||||||
|
if not cc then
|
||||||
local logger = log.new('install/' .. lang)
|
cc_err()
|
||||||
|
return
|
||||||
generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar
|
|
||||||
|
|
||||||
if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then
|
|
||||||
logger:error('tree-sitter CLI not found: `tree-sitter` is not executable')
|
|
||||||
end
|
|
||||||
|
|
||||||
if generate_from_grammar and vim.fn.executable('node') ~= 1 then
|
|
||||||
logger:error('Node JS not found: `node` is not executable')
|
|
||||||
end
|
|
||||||
|
|
||||||
local revision = repo.revision or get_target_revision(lang)
|
|
||||||
|
|
||||||
local maybe_local_path = fs.normalize(repo.url)
|
|
||||||
local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1
|
|
||||||
if from_local_path then
|
|
||||||
repo.url = maybe_local_path
|
|
||||||
end
|
|
||||||
|
|
||||||
if not from_local_path then
|
|
||||||
util.delete(fs.joinpath(cache_dir, project_name))
|
|
||||||
local project_dir = fs.joinpath(cache_dir, project_name)
|
|
||||||
|
|
||||||
revision = revision or repo.branch or 'master'
|
|
||||||
|
|
||||||
if can_download_tar(repo) then
|
|
||||||
do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir)
|
|
||||||
else
|
|
||||||
do_download_git(logger, repo, project_name, cache_dir, revision, project_dir)
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path)
|
local project_name = 'tree-sitter-' .. lang
|
||||||
|
|
||||||
if generate_from_grammar then
|
generate_from_grammar = repo.requires_generate_from_grammar or generate_from_grammar
|
||||||
do_generate_from_grammar(logger, repo, compile_location)
|
|
||||||
end
|
|
||||||
|
|
||||||
logger:info('Compiling parser')
|
if generate_from_grammar and vim.fn.executable('tree-sitter') ~= 1 then
|
||||||
local r = do_compile(repo, cc, compile_location)
|
logger:error('tree-sitter CLI not found: `tree-sitter` is not executable')
|
||||||
if r.exit_code > 0 then
|
end
|
||||||
logger:error('Error during compilation: ' .. vim.inspect(r.stderr))
|
|
||||||
end
|
|
||||||
|
|
||||||
local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so'
|
if generate_from_grammar and vim.fn.executable('node') ~= 1 then
|
||||||
|
logger:error('Node JS not found: `node` is not executable')
|
||||||
|
end
|
||||||
|
|
||||||
local err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name)
|
local revision = repo.revision or get_target_revision(lang)
|
||||||
a.main()
|
|
||||||
if err then
|
|
||||||
logger:error(err)
|
|
||||||
end
|
|
||||||
|
|
||||||
local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision')
|
local maybe_local_path = fs.normalize(repo.url)
|
||||||
util.write_file(revfile, revision or '')
|
local from_local_path = vim.fn.isdirectory(maybe_local_path) == 1
|
||||||
|
if from_local_path then
|
||||||
|
repo.url = maybe_local_path
|
||||||
|
end
|
||||||
|
|
||||||
if not from_local_path then
|
if not from_local_path then
|
||||||
util.delete(fs.joinpath(cache_dir, project_name))
|
util.delete(fs.joinpath(cache_dir, project_name))
|
||||||
|
local project_dir = fs.joinpath(cache_dir, project_name)
|
||||||
|
|
||||||
|
revision = revision or repo.branch or 'master'
|
||||||
|
|
||||||
|
if can_download_tar(repo) then
|
||||||
|
do_download_tar(logger, repo, project_name, cache_dir, revision, project_dir)
|
||||||
|
else
|
||||||
|
do_download_git(logger, repo, project_name, cache_dir, revision, project_dir)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local compile_location = get_compile_location(repo, cache_dir, project_name, from_local_path)
|
||||||
|
|
||||||
|
if generate_from_grammar then
|
||||||
|
do_generate_from_grammar(logger, repo, compile_location)
|
||||||
|
end
|
||||||
|
|
||||||
|
logger:info('Compiling parser')
|
||||||
|
local r = do_compile(repo, cc, compile_location)
|
||||||
|
if r.exit_code > 0 then
|
||||||
|
logger:error('Error during compilation: ' .. vim.inspect(r.stderr))
|
||||||
|
end
|
||||||
|
|
||||||
|
local parser_lib_name = fs.joinpath(install_dir, lang) .. '.so'
|
||||||
|
|
||||||
|
err = uv_copyfile(fs.joinpath(compile_location, 'parser.so'), parser_lib_name)
|
||||||
|
a.main()
|
||||||
|
if err then
|
||||||
|
logger:error(err)
|
||||||
|
end
|
||||||
|
|
||||||
|
local revfile = fs.joinpath(config.get_install_dir('parser-info') or '', lang .. '.revision')
|
||||||
|
util.write_file(revfile, revision or '')
|
||||||
|
|
||||||
|
if not from_local_path then
|
||||||
|
util.delete(fs.joinpath(cache_dir, project_name))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local queries = fs.joinpath(config.get_install_dir('queries'), lang)
|
local queries = fs.joinpath(config.get_install_dir('queries'), lang)
|
||||||
|
|
@ -524,7 +526,7 @@ local function install_lang(lang, cache_dir, install_dir, force, generate_from_g
|
||||||
if err then
|
if err then
|
||||||
logger:error(err)
|
logger:error(err)
|
||||||
end
|
end
|
||||||
logger:info('Parser installed')
|
logger:info('Language installed')
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Throttles a function using the first argument as an ID
|
--- Throttles a function using the first argument as an ID
|
||||||
|
|
@ -614,7 +616,7 @@ local function install(languages, options, _callback)
|
||||||
a.join(max_jobs, nil, tasks)
|
a.join(max_jobs, nil, tasks)
|
||||||
if #tasks > 1 then
|
if #tasks > 1 then
|
||||||
a.main()
|
a.main()
|
||||||
log.info('Installed %d/%d parsers', done, #tasks)
|
log.info('Installed %d/%d languages', done, #tasks)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -647,34 +649,35 @@ end, 2)
|
||||||
local function uninstall_lang(lang, parser, queries)
|
local function uninstall_lang(lang, parser, queries)
|
||||||
local logger = log.new('uninstall/' .. lang)
|
local logger = log.new('uninstall/' .. lang)
|
||||||
logger:debug('Uninstalling ' .. lang)
|
logger:debug('Uninstalling ' .. lang)
|
||||||
if vim.fn.filereadable(parser) ~= 1 then
|
|
||||||
return
|
if vim.fn.filereadable(parser) == 1 then
|
||||||
|
logger:debug('Unlinking ' .. parser)
|
||||||
|
local perr = uv_unlink(parser)
|
||||||
|
a.main()
|
||||||
|
|
||||||
|
if perr then
|
||||||
|
log.error(perr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
logger:debug('Unlinking ' .. parser)
|
if vim.fn.isdirectory(queries) == 1 then
|
||||||
local perr = uv_unlink(parser)
|
logger:debug('Unlinking ' .. queries)
|
||||||
a.main()
|
local qerr = uv_unlink(queries)
|
||||||
|
a.main()
|
||||||
|
|
||||||
if perr then
|
if qerr then
|
||||||
log.error(perr)
|
logger:error(qerr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
logger:debug('Unlinking ' .. queries)
|
logger:info('Language uninstalled')
|
||||||
local qerr = uv_unlink(queries)
|
|
||||||
a.main()
|
|
||||||
|
|
||||||
if qerr then
|
|
||||||
logger:error(qerr)
|
|
||||||
end
|
|
||||||
|
|
||||||
logger:info('Parser uninstalled')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param languages string[]|string
|
--- @param languages string[]|string
|
||||||
--- @param _options? UpdateOptions
|
--- @param _options? UpdateOptions
|
||||||
--- @param _callback fun()
|
--- @param _callback fun()
|
||||||
M.uninstall = a.sync(function(languages, _options, _callback)
|
M.uninstall = a.sync(function(languages, _options, _callback)
|
||||||
languages = config.norm_languages(languages or 'all', { missing = true })
|
languages = config.norm_languages(languages or 'all', { missing = true, dependencies = true })
|
||||||
|
|
||||||
local parser_dir = config.get_install_dir('parser')
|
local parser_dir = config.get_install_dir('parser')
|
||||||
local query_dir = config.get_install_dir('queries')
|
local query_dir = config.get_install_dir('queries')
|
||||||
|
|
@ -698,7 +701,7 @@ M.uninstall = a.sync(function(languages, _options, _callback)
|
||||||
a.join(max_jobs, nil, tasks)
|
a.join(max_jobs, nil, tasks)
|
||||||
if #tasks > 1 then
|
if #tasks > 1 then
|
||||||
a.main()
|
a.main()
|
||||||
log.info('Uninstalled %d/%d parsers', done, #tasks)
|
log.info('Uninstalled %d/%d languages', done, #tasks)
|
||||||
end
|
end
|
||||||
end, 2)
|
end, 2)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
---@field install_info InstallInfo
|
---@field install_info InstallInfo
|
||||||
---@field filetype string[]
|
---@field filetype string[]
|
||||||
---@field maintainers string[]
|
---@field maintainers string[]
|
||||||
|
---@field requires string[]
|
||||||
---@field tier integer|nil
|
---@field tier integer|nil
|
||||||
---@field readme_note string|nil
|
---@field readme_note string|nil
|
||||||
|
|
||||||
|
|
@ -43,6 +44,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@ObserverOfTime' },
|
maintainers = { '@ObserverOfTime' },
|
||||||
|
requires = { 'cpp' },
|
||||||
},
|
},
|
||||||
|
|
||||||
astro = {
|
astro = {
|
||||||
|
|
@ -51,6 +53,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.cc' },
|
files = { 'src/parser.c', 'src/scanner.cc' },
|
||||||
},
|
},
|
||||||
maintainers = { '@virchau13' },
|
maintainers = { '@virchau13' },
|
||||||
|
requires = { 'html', 'html_tags' },
|
||||||
},
|
},
|
||||||
|
|
||||||
awk = {
|
awk = {
|
||||||
|
|
@ -225,6 +228,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@theHamsta' },
|
maintainers = { '@theHamsta' },
|
||||||
|
requires = { 'c' },
|
||||||
},
|
},
|
||||||
|
|
||||||
css = {
|
css = {
|
||||||
|
|
@ -242,6 +246,7 @@ M.configs = {
|
||||||
location = 'csv',
|
location = 'csv',
|
||||||
},
|
},
|
||||||
maintainers = { '@amaanq' },
|
maintainers = { '@amaanq' },
|
||||||
|
requires = { 'tsv' },
|
||||||
tier = 2,
|
tier = 2,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -252,6 +257,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@theHamsta' },
|
maintainers = { '@theHamsta' },
|
||||||
|
requires = { 'cpp' },
|
||||||
},
|
},
|
||||||
|
|
||||||
cue = {
|
cue = {
|
||||||
|
|
@ -349,6 +355,11 @@ M.configs = {
|
||||||
tier = 4,
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ecma = {
|
||||||
|
maintainers = { '@steelsojka' },
|
||||||
|
readme_note = 'queries required by javascript, typescript, tsx, qmljs',
|
||||||
|
},
|
||||||
|
|
||||||
eex = {
|
eex = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = 'https://github.com/connorlay/tree-sitter-eex',
|
url = 'https://github.com/connorlay/tree-sitter-eex',
|
||||||
|
|
@ -394,6 +405,7 @@ M.configs = {
|
||||||
url = 'https://github.com/tree-sitter/tree-sitter-embedded-template',
|
url = 'https://github.com/tree-sitter/tree-sitter-embedded-template',
|
||||||
files = { 'src/parser.c' },
|
files = { 'src/parser.c' },
|
||||||
},
|
},
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
erlang = {
|
erlang = {
|
||||||
|
|
@ -552,6 +564,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@theHamsta' },
|
maintainers = { '@theHamsta' },
|
||||||
|
requires = { 'c' },
|
||||||
},
|
},
|
||||||
|
|
||||||
go = {
|
go = {
|
||||||
|
|
@ -626,6 +639,7 @@ M.configs = {
|
||||||
url = 'https://github.com/slackhq/tree-sitter-hack',
|
url = 'https://github.com/slackhq/tree-sitter-hack',
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
hare = {
|
hare = {
|
||||||
|
|
@ -641,6 +655,7 @@ M.configs = {
|
||||||
url = 'https://github.com/tree-sitter/tree-sitter-haskell',
|
url = 'https://github.com/tree-sitter/tree-sitter-haskell',
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
haskell_persistent = {
|
haskell_persistent = {
|
||||||
|
|
@ -675,6 +690,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@winston0410' },
|
maintainers = { '@winston0410' },
|
||||||
|
requires = { 'json' },
|
||||||
},
|
},
|
||||||
|
|
||||||
hlsl = {
|
hlsl = {
|
||||||
|
|
@ -684,6 +700,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@theHamsta' },
|
maintainers = { '@theHamsta' },
|
||||||
|
requires = { 'cpp' },
|
||||||
},
|
},
|
||||||
|
|
||||||
hocon = {
|
hocon = {
|
||||||
|
|
@ -704,12 +721,18 @@ M.configs = {
|
||||||
tier = 4,
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
html_tags = {
|
||||||
|
maintainers = { '@TravonteD' },
|
||||||
|
readme_note = 'queries required by html, astro, vue, svelte',
|
||||||
|
},
|
||||||
|
|
||||||
html = {
|
html = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = 'https://github.com/tree-sitter/tree-sitter-html',
|
url = 'https://github.com/tree-sitter/tree-sitter-html',
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@TravonteD' },
|
maintainers = { '@TravonteD' },
|
||||||
|
requires = { 'html_tags' },
|
||||||
},
|
},
|
||||||
|
|
||||||
htmldjango = {
|
htmldjango = {
|
||||||
|
|
@ -755,6 +778,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@fab4100' },
|
maintainers = { '@fab4100' },
|
||||||
|
requires = { 'c' },
|
||||||
},
|
},
|
||||||
|
|
||||||
janet_simple = {
|
janet_simple = {
|
||||||
|
|
@ -779,6 +803,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@steelsojka' },
|
maintainers = { '@steelsojka' },
|
||||||
|
requires = { 'ecma', 'jsx' },
|
||||||
},
|
},
|
||||||
|
|
||||||
jq = {
|
jq = {
|
||||||
|
|
@ -820,7 +845,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@WhyNotHugo' },
|
maintainers = { '@WhyNotHugo' },
|
||||||
readme_note = 'JSON with comments',
|
requires = { 'json' },
|
||||||
},
|
},
|
||||||
|
|
||||||
jsonnet = {
|
jsonnet = {
|
||||||
|
|
@ -831,6 +856,11 @@ M.configs = {
|
||||||
maintainers = { '@nawordar' },
|
maintainers = { '@nawordar' },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
jsx = {
|
||||||
|
maintainers = { '@steelsojka' },
|
||||||
|
readme_note = 'queries required by javascript, tsx',
|
||||||
|
},
|
||||||
|
|
||||||
julia = {
|
julia = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = 'https://github.com/tree-sitter/tree-sitter-julia',
|
url = 'https://github.com/tree-sitter/tree-sitter-julia',
|
||||||
|
|
@ -903,8 +933,8 @@ M.configs = {
|
||||||
url = 'https://github.com/MunifTanjim/tree-sitter-lua',
|
url = 'https://github.com/MunifTanjim/tree-sitter-lua',
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
tier = 1,
|
|
||||||
maintainers = { '@muniftanjim' },
|
maintainers = { '@muniftanjim' },
|
||||||
|
tier = 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
luadoc = {
|
luadoc = {
|
||||||
|
|
@ -930,6 +960,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@amaanq' },
|
maintainers = { '@amaanq' },
|
||||||
|
requires = { 'lua' },
|
||||||
},
|
},
|
||||||
|
|
||||||
m68k = {
|
m68k = {
|
||||||
|
|
@ -956,6 +987,7 @@ M.configs = {
|
||||||
},
|
},
|
||||||
maintainers = { '@MDeiml' },
|
maintainers = { '@MDeiml' },
|
||||||
readme_note = 'basic highlighting',
|
readme_note = 'basic highlighting',
|
||||||
|
requires = { 'markdown_inline' },
|
||||||
tier = 1,
|
tier = 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1008,8 +1040,8 @@ M.configs = {
|
||||||
files = { 'src/parser.c' },
|
files = { 'src/parser.c' },
|
||||||
requires_generate_from_grammar = true,
|
requires_generate_from_grammar = true,
|
||||||
},
|
},
|
||||||
tier = 4,
|
|
||||||
maintainers = { '@artagnon' },
|
maintainers = { '@artagnon' },
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
nickel = {
|
nickel = {
|
||||||
|
|
@ -1017,6 +1049,7 @@ M.configs = {
|
||||||
url = 'https://github.com/nickel-lang/tree-sitter-nickel',
|
url = 'https://github.com/nickel-lang/tree-sitter-nickel',
|
||||||
files = { 'src/parser.c', 'src/scanner.cc' },
|
files = { 'src/parser.c', 'src/scanner.cc' },
|
||||||
},
|
},
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
ninja = {
|
ninja = {
|
||||||
|
|
@ -1041,8 +1074,8 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.cc' },
|
files = { 'src/parser.c', 'src/scanner.cc' },
|
||||||
use_makefile = true,
|
use_makefile = true,
|
||||||
},
|
},
|
||||||
tier = 4,
|
|
||||||
maintainers = { '@JoeyGrajciar', '@vhyrro' },
|
maintainers = { '@JoeyGrajciar', '@vhyrro' },
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
nqc = {
|
nqc = {
|
||||||
|
|
@ -1060,6 +1093,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c' },
|
files = { 'src/parser.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@amaanq' },
|
maintainers = { '@amaanq' },
|
||||||
|
requires = { 'c' },
|
||||||
},
|
},
|
||||||
|
|
||||||
ocaml = {
|
ocaml = {
|
||||||
|
|
@ -1078,6 +1112,7 @@ M.configs = {
|
||||||
location = 'interface',
|
location = 'interface',
|
||||||
},
|
},
|
||||||
maintainers = { '@undu' },
|
maintainers = { '@undu' },
|
||||||
|
requires = { 'ocaml' },
|
||||||
},
|
},
|
||||||
|
|
||||||
ocamllex = {
|
ocamllex = {
|
||||||
|
|
@ -1102,6 +1137,7 @@ M.configs = {
|
||||||
url = 'https://github.com/milisims/tree-sitter-org',
|
url = 'https://github.com/milisims/tree-sitter-org',
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
|
tier = 4,
|
||||||
},
|
},
|
||||||
|
|
||||||
pascal = {
|
pascal = {
|
||||||
|
|
@ -1229,6 +1265,7 @@ M.configs = {
|
||||||
location = 'psv',
|
location = 'psv',
|
||||||
},
|
},
|
||||||
maintainers = { '@amaanq' },
|
maintainers = { '@amaanq' },
|
||||||
|
requires = { 'tsv' },
|
||||||
tier = 2,
|
tier = 2,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1289,6 +1326,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@Decodetalkers' },
|
maintainers = { '@Decodetalkers' },
|
||||||
|
requires = { 'ecma' },
|
||||||
},
|
},
|
||||||
|
|
||||||
query = {
|
query = {
|
||||||
|
|
@ -1441,6 +1479,8 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@elianiva' },
|
maintainers = { '@elianiva' },
|
||||||
|
requires = { 'css' },
|
||||||
|
tier = 3,
|
||||||
},
|
},
|
||||||
|
|
||||||
slint = {
|
slint = {
|
||||||
|
|
@ -1540,6 +1580,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.c' },
|
files = { 'src/parser.c', 'src/scanner.c' },
|
||||||
},
|
},
|
||||||
maintainers = { '@elianiva' },
|
maintainers = { '@elianiva' },
|
||||||
|
requires = { 'html_tags' },
|
||||||
},
|
},
|
||||||
|
|
||||||
swift = {
|
swift = {
|
||||||
|
|
@ -1601,6 +1642,8 @@ M.configs = {
|
||||||
location = 'dialects/terraform',
|
location = 'dialects/terraform',
|
||||||
},
|
},
|
||||||
maintainers = { '@MichaHoffmann' },
|
maintainers = { '@MichaHoffmann' },
|
||||||
|
requires = { 'hcl' },
|
||||||
|
tier = 3,
|
||||||
},
|
},
|
||||||
|
|
||||||
thrift = {
|
thrift = {
|
||||||
|
|
@ -1663,6 +1706,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@steelsojka' },
|
maintainers = { '@steelsojka' },
|
||||||
|
requires = { 'ecma', 'jsx', 'typescript' },
|
||||||
},
|
},
|
||||||
|
|
||||||
turtle = {
|
turtle = {
|
||||||
|
|
@ -1689,6 +1733,7 @@ M.configs = {
|
||||||
generate_requires_npm = true,
|
generate_requires_npm = true,
|
||||||
},
|
},
|
||||||
maintainers = { '@steelsojka' },
|
maintainers = { '@steelsojka' },
|
||||||
|
requires = { 'ecma' },
|
||||||
},
|
},
|
||||||
|
|
||||||
ungrammar = {
|
ungrammar = {
|
||||||
|
|
@ -1783,6 +1828,7 @@ M.configs = {
|
||||||
files = { 'src/parser.c', 'src/scanner.cc' },
|
files = { 'src/parser.c', 'src/scanner.cc' },
|
||||||
},
|
},
|
||||||
maintainers = { '@WhyNotHugo' },
|
maintainers = { '@WhyNotHugo' },
|
||||||
|
requires = { 'html_tags' },
|
||||||
},
|
},
|
||||||
|
|
||||||
wing = {
|
wing = {
|
||||||
|
|
@ -1820,6 +1866,7 @@ M.configs = {
|
||||||
location = 'tree-sitter-xml',
|
location = 'tree-sitter-xml',
|
||||||
},
|
},
|
||||||
maintainers = { '@ObserverOfTime' },
|
maintainers = { '@ObserverOfTime' },
|
||||||
|
requires = { 'dtd' },
|
||||||
tier = 2,
|
tier = 2,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,21 +21,12 @@ end)
|
||||||
|
|
||||||
-- check for new revisions
|
-- check for new revisions
|
||||||
for _, v in ipairs(sorted_parsers) do
|
for _, v in ipairs(sorted_parsers) do
|
||||||
if skip_langs and not vim.list_contains(skip_langs, v.name) then
|
if not vim.list_contains(skip_langs, v.name) and v.parser.install_info then
|
||||||
local sha ---@type string
|
local cmd = 'git ls-remote ' .. v.parser.install_info.url
|
||||||
if v.parser.install_info.branch then
|
if v.parser.install_info.branch then
|
||||||
sha = vim.split(
|
cmd = cmd .. ' | grep refs/heads/' .. v.parser.install_info.branch
|
||||||
vim.fn.systemlist(
|
|
||||||
'git ls-remote '
|
|
||||||
.. v.parser.install_info.url
|
|
||||||
.. ' | grep refs/heads/'
|
|
||||||
.. v.parser.install_info.branch
|
|
||||||
)[1],
|
|
||||||
'\t'
|
|
||||||
)[1]
|
|
||||||
else
|
|
||||||
sha = vim.split(vim.fn.systemlist('git ls-remote ' .. v.parser.install_info.url)[1], '\t')[1]
|
|
||||||
end
|
end
|
||||||
|
local sha = vim.split(vim.fn.systemlist(cmd)[1], '\t')[1]
|
||||||
lockfile[v.name] = { revision = sha }
|
lockfile[v.name] = { revision = sha }
|
||||||
print(v.name .. ': ' .. sha)
|
print(v.name .. ': ' .. sha)
|
||||||
else
|
else
|
||||||
|
|
@ -43,5 +34,8 @@ for _, v in ipairs(sorted_parsers) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
lockfile = vim.fn.system('jq --sort-keys', vim.json.encode(lockfile))
|
lockfile = vim.json.encode(lockfile)
|
||||||
|
if vim.fn.executable('jq') == 1 then
|
||||||
|
lockfile = vim.fn.system('jq --sort-keys', lockfile)
|
||||||
|
end
|
||||||
util.write_file(filename, lockfile)
|
util.write_file(filename, lockfile)
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,23 @@ local footnotes = ''
|
||||||
for _, v in ipairs(sorted_parsers) do
|
for _, v in ipairs(sorted_parsers) do
|
||||||
local p = v.parser
|
local p = v.parser
|
||||||
-- language
|
-- language
|
||||||
generated_text = generated_text
|
if p.install_info then
|
||||||
.. '['
|
generated_text = generated_text
|
||||||
.. v.name
|
.. '['
|
||||||
.. ']('
|
.. v.name
|
||||||
.. p.install_info.url
|
.. ']('
|
||||||
.. ')'
|
.. p.install_info.url
|
||||||
.. (p.readme_note and '[^' .. v.name .. ']' or '')
|
.. ')'
|
||||||
.. ' | '
|
.. (p.readme_note and '[^' .. v.name .. ']' or '')
|
||||||
|
.. ' | '
|
||||||
|
else
|
||||||
|
generated_text = generated_text
|
||||||
|
.. v.name
|
||||||
|
.. ' (queries only)'
|
||||||
|
.. (p.readme_note and '[^' .. v.name .. ']' or '')
|
||||||
|
.. ' | '
|
||||||
|
end
|
||||||
|
|
||||||
if p.readme_note then
|
if p.readme_note then
|
||||||
footnotes = footnotes .. '[^' .. v.name .. ']: ' .. p.readme_note .. '\n'
|
footnotes = footnotes .. '[^' .. v.name .. ']: ' .. p.readme_note .. '\n'
|
||||||
end
|
end
|
||||||
|
|
@ -50,11 +59,13 @@ for _, v in ipairs(sorted_parsers) do
|
||||||
|
|
||||||
-- CLI
|
-- CLI
|
||||||
generated_text = generated_text
|
generated_text = generated_text
|
||||||
.. (p.install_info.requires_generate_from_grammar and '✓' or '')
|
.. (p.install_info and p.install_info.requires_generate_from_grammar and '✓' or '')
|
||||||
.. ' | '
|
.. ' | '
|
||||||
|
|
||||||
-- NPM
|
-- NPM
|
||||||
generated_text = generated_text .. (p.install_info.generate_requires_npm and '✓' or '') .. ' | '
|
generated_text = generated_text
|
||||||
|
.. (p.install_info and p.install_info.generate_requires_npm and '✓' or '')
|
||||||
|
.. ' | '
|
||||||
|
|
||||||
-- Maintainer
|
-- Maintainer
|
||||||
generated_text = generated_text
|
generated_text = generated_text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue