refactor(ts): own parser installation, split from pack

This commit is contained in:
2026-04-20 22:50:16 +02:00
parent c7dd083083
commit 21f566112e
3 changed files with 201 additions and 212 deletions
+50 -98
View File
@@ -22,7 +22,6 @@ for _, file in ipairs(files) do
end
end
local ts = require("ts")
require("pack").setup({
"https://github.com/navarasu/onedark.nvim",
"https://github.com/ibhagwan/fzf-lua",
@@ -42,105 +41,58 @@ require("pack").setup({
"https://github.com/saghen/blink.cmp",
version = vim.version.range("^1"),
},
{
"https://github.com/tree-sitter/tree-sitter-bash",
ts_parser = "bash",
},
-- required by cpp
{
"https://github.com/tree-sitter/tree-sitter-c",
ts_parser = "c",
},
{
"https://github.com/stsewd/tree-sitter-comment",
ts_parser = "comment",
},
{
"https://github.com/tree-sitter/tree-sitter-cpp",
ts_parser = "cpp",
},
-- required by scss
{
"https://github.com/tree-sitter/tree-sitter-css",
ts_parser = "css",
},
{
"https://github.com/gbprod/tree-sitter-gitcommit",
ts_parser = "gitcommit",
},
{
"https://github.com/tree-sitter/tree-sitter-go",
ts_parser = "go",
},
{
"https://github.com/ngalaiko/tree-sitter-go-template",
ts_parser = "gotmpl",
},
{
"https://github.com/tree-sitter/tree-sitter-html",
ts_parser = "html",
},
{
"https://github.com/tree-sitter/tree-sitter-json",
ts_parser = "json",
},
{
"https://github.com/tree-sitter-grammars/tree-sitter-luadoc",
ts_parser = "luadoc",
},
{
"https://github.com/tree-sitter/tree-sitter-php",
ts_parser = {
{ lang = "php", location = "php" },
{ lang = "php_only", location = "php_only" },
},
},
{
"https://github.com/tree-sitter/tree-sitter-python",
ts_parser = "python",
},
{
"https://github.com/tree-sitter/tree-sitter-rust",
ts_parser = "rust",
},
{
"https://github.com/serenadeai/tree-sitter-scss",
ts_parser = "scss",
},
{
"https://github.com/derekstride/tree-sitter-sql",
version = "gh-pages",
ts_parser = "sql",
},
{
"https://github.com/tree-sitter-grammars/tree-sitter-svelte",
ts_parser = "svelte",
},
{
"https://github.com/tree-sitter/tree-sitter-typescript",
ts_parser = {
{ lang = "typescript", location = "typescript" },
{ lang = "tsx", location = "tsx" },
},
},
{
"https://github.com/tree-sitter-grammars/tree-sitter-xml",
ts_parser = {
{ lang = "xml", location = "xml" },
{ lang = "dtd", location = "dtd" },
},
},
{
"https://github.com/tree-sitter-grammars/tree-sitter-yaml",
ts_parser = "yaml",
},
{
"https://github.com/georgeharker/tree-sitter-zsh",
ts_parser = "zsh",
},
})
ts.setup({
require("ts").setup({
parsers = {
"https://github.com/tree-sitter/tree-sitter-bash",
-- required by cpp
"https://github.com/tree-sitter/tree-sitter-c",
"https://github.com/stsewd/tree-sitter-comment",
"https://github.com/tree-sitter/tree-sitter-cpp",
-- required by scss
"https://github.com/tree-sitter/tree-sitter-css",
"https://github.com/gbprod/tree-sitter-gitcommit",
"https://github.com/tree-sitter/tree-sitter-go",
{
"https://github.com/ngalaiko/tree-sitter-go-template",
lang = "gotmpl",
},
"https://github.com/tree-sitter/tree-sitter-html",
"https://github.com/tree-sitter/tree-sitter-json",
"https://github.com/tree-sitter-grammars/tree-sitter-luadoc",
{
"https://github.com/tree-sitter/tree-sitter-php",
specs = {
{ lang = "php", location = "php" },
{ lang = "php_only", location = "php_only" },
},
},
"https://github.com/tree-sitter/tree-sitter-python",
"https://github.com/tree-sitter/tree-sitter-rust",
"https://github.com/serenadeai/tree-sitter-scss",
{
"https://github.com/derekstride/tree-sitter-sql",
version = "gh-pages",
},
"https://github.com/tree-sitter-grammars/tree-sitter-svelte",
{
"https://github.com/tree-sitter/tree-sitter-typescript",
specs = {
{ lang = "typescript", location = "typescript" },
{ lang = "tsx", location = "tsx" },
},
},
{
"https://github.com/tree-sitter-grammars/tree-sitter-xml",
specs = {
{ lang = "xml", location = "xml" },
{ lang = "dtd", location = "dtd" },
},
},
"https://github.com/tree-sitter-grammars/tree-sitter-yaml",
"https://github.com/georgeharker/tree-sitter-zsh",
},
languages = {
"bash",
"c", -- builtin