Update generated neovim config
This commit is contained in:
@ -98,7 +98,7 @@ list.apex = {
|
||||
files = { "src/parser.c" },
|
||||
location = "apex",
|
||||
},
|
||||
maintainers = { "@aheber" },
|
||||
maintainers = { "@aheber", "@xixiaofinland" },
|
||||
}
|
||||
|
||||
list.arduino = {
|
||||
@ -633,6 +633,24 @@ list.fusion = {
|
||||
maintainers = { "@jirgn" },
|
||||
}
|
||||
|
||||
list.gap = {
|
||||
install_info = {
|
||||
url = "https://github.com/gap-system/tree-sitter-gap",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@reiniscirpons" },
|
||||
readme_name = "GAP system",
|
||||
}
|
||||
|
||||
list.gaptst = {
|
||||
install_info = {
|
||||
url = "https://github.com/gap-system/tree-sitter-gaptst",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@reiniscirpons" },
|
||||
readme_name = "GAP system test files",
|
||||
}
|
||||
|
||||
list.gdscript = {
|
||||
install_info = {
|
||||
url = "https://github.com/PrestonKnopp/tree-sitter-gdscript",
|
||||
@ -704,7 +722,7 @@ list.gleam = {
|
||||
|
||||
list.glimmer = {
|
||||
install_info = {
|
||||
url = "https://github.com/alexlafroscia/tree-sitter-glimmer",
|
||||
url = "https://github.com/ember-tooling/tree-sitter-glimmer",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
filetype = "handlebars",
|
||||
@ -712,6 +730,26 @@ list.glimmer = {
|
||||
readme_name = "Glimmer and Ember",
|
||||
}
|
||||
|
||||
list.glimmer_javascript = {
|
||||
install_info = {
|
||||
url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
generate_requires_npm = true,
|
||||
},
|
||||
filetype = "javascript.glimmer",
|
||||
maintainers = { "@NullVoxPopuli" },
|
||||
}
|
||||
|
||||
list.glimmer_typescript = {
|
||||
install_info = {
|
||||
url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
generate_requires_npm = true,
|
||||
},
|
||||
filetype = "typescript.glimmer",
|
||||
maintainers = { "@NullVoxPopuli" },
|
||||
}
|
||||
|
||||
list.glsl = {
|
||||
install_info = {
|
||||
url = "https://github.com/theHamsta/tree-sitter-glsl",
|
||||
@ -1495,7 +1533,7 @@ list.php = {
|
||||
location = "php",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@tk-shirasaka" },
|
||||
maintainers = { "@tk-shirasaka", "@calebdw" },
|
||||
}
|
||||
|
||||
list.php_only = {
|
||||
@ -1504,7 +1542,7 @@ list.php_only = {
|
||||
location = "php_only",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@tk-shirasaka" },
|
||||
maintainers = { "@tk-shirasaka", "@calebdw" },
|
||||
}
|
||||
|
||||
-- Parsers for injections
|
||||
@ -1908,6 +1946,15 @@ list.scss = {
|
||||
maintainers = { "@elianiva" },
|
||||
}
|
||||
|
||||
list.sflog = {
|
||||
install_info = {
|
||||
url = "https://github.com/aheber/tree-sitter-sfapex",
|
||||
files = { "src/parser.c" },
|
||||
location = "sflog",
|
||||
},
|
||||
maintainers = { "@aheber", "@xixiaofinland" },
|
||||
}
|
||||
|
||||
list.slang = {
|
||||
install_info = {
|
||||
url = "https://github.com/theHamsta/tree-sitter-slang",
|
||||
@ -1966,7 +2013,7 @@ list.soql = {
|
||||
files = { "src/parser.c" },
|
||||
location = "soql",
|
||||
},
|
||||
maintainers = { "@aheber" },
|
||||
maintainers = { "@aheber", "@xixiaofinland" },
|
||||
}
|
||||
|
||||
list.sosl = {
|
||||
@ -1975,7 +2022,7 @@ list.sosl = {
|
||||
files = { "src/parser.c" },
|
||||
location = "sosl",
|
||||
},
|
||||
maintainers = { "@aheber" },
|
||||
maintainers = { "@aheber", "@xixiaofinland" },
|
||||
}
|
||||
|
||||
list.sourcepawn = {
|
||||
@ -2499,10 +2546,10 @@ list.zathurarc = {
|
||||
|
||||
list.zig = {
|
||||
install_info = {
|
||||
url = "https://github.com/maxxnino/tree-sitter-zig",
|
||||
url = "https://github.com/tree-sitter-grammars/tree-sitter-zig",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = { "@maxxnino" },
|
||||
maintainers = { "@amaanq" },
|
||||
}
|
||||
|
||||
list.templ = {
|
||||
|
||||
@ -248,7 +248,7 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
|
||||
return t
|
||||
end
|
||||
|
||||
local matches = query:iter_matches(qnode, bufnr, start_row, end_row)
|
||||
local matches = query:iter_matches(qnode, bufnr, start_row, end_row, { all = false })
|
||||
|
||||
local function iterator()
|
||||
local pattern, match, metadata = matches()
|
||||
|
||||
@ -15,6 +15,9 @@ local non_filetype_match_injection_language_aliases = {
|
||||
ts = "typescript",
|
||||
}
|
||||
|
||||
-- compatibility shim for breaking change on nightly/0.11
|
||||
local opts = vim.fn.has "nvim-0.10" == 1 and { force = true, all = false } or true
|
||||
|
||||
local function get_parser_from_markdown_info_string(injection_alias)
|
||||
local match = vim.filetype.match { filename = "a." .. injection_alias }
|
||||
return match or non_filetype_match_injection_language_aliases[injection_alias] or injection_alias
|
||||
@ -57,7 +60,7 @@ query.add_predicate("nth?", function(match, _pattern, _bufnr, pred)
|
||||
end
|
||||
|
||||
return false
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
---@param match (TSNode|nil)[]
|
||||
---@param _pattern string
|
||||
@ -91,9 +94,9 @@ local function has_ancestor(match, _pattern, _bufnr, pred)
|
||||
return false
|
||||
end
|
||||
|
||||
query.add_predicate("has-ancestor?", has_ancestor, true)
|
||||
query.add_predicate("has-ancestor?", has_ancestor, opts)
|
||||
|
||||
query.add_predicate("has-parent?", has_ancestor, true)
|
||||
query.add_predicate("has-parent?", has_ancestor, opts)
|
||||
|
||||
---@param match (TSNode|nil)[]
|
||||
---@param _pattern string
|
||||
@ -117,7 +120,7 @@ query.add_predicate("is?", function(match, _pattern, bufnr, pred)
|
||||
local _, _, kind = locals.find_definition(node, bufnr)
|
||||
|
||||
return vim.tbl_contains(types, kind)
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
---@param match (TSNode|nil)[]
|
||||
---@param _pattern string
|
||||
@ -137,7 +140,7 @@ query.add_predicate("kind-eq?", function(match, _pattern, _bufnr, pred)
|
||||
end
|
||||
|
||||
return vim.tbl_contains(types, node:type())
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
---@param match (TSNode|nil)[]
|
||||
---@param _ string
|
||||
@ -158,7 +161,7 @@ query.add_directive("set-lang-from-mimetype!", function(match, _, bufnr, pred, m
|
||||
local parts = vim.split(type_attr_value, "/", {})
|
||||
metadata["injection.language"] = parts[#parts]
|
||||
end
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
---@param match (TSNode|nil)[]
|
||||
---@param _ string
|
||||
@ -173,10 +176,10 @@ query.add_directive("set-lang-from-info-string!", function(match, _, bufnr, pred
|
||||
end
|
||||
local injection_alias = vim.treesitter.get_node_text(node, bufnr):lower()
|
||||
metadata["injection.language"] = get_parser_from_markdown_info_string(injection_alias)
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
-- Just avoid some annoying warnings for this directive
|
||||
query.add_directive("make-range!", function() end, true)
|
||||
query.add_directive("make-range!", function() end, opts)
|
||||
|
||||
--- transform node text to lower case (e.g., to make @injection.language case insensitive)
|
||||
---
|
||||
@ -197,7 +200,7 @@ query.add_directive("downcase!", function(match, _, bufnr, pred, metadata)
|
||||
metadata[id] = {}
|
||||
end
|
||||
metadata[id].text = string.lower(text)
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
-- Trim blank lines from end of the region
|
||||
-- Arguments are the captures to trim.
|
||||
@ -235,4 +238,4 @@ query.add_directive("trim!", function(match, _, bufnr, pred, metadata)
|
||||
metadata[id].range = { start_row, start_col, end_row, end_col }
|
||||
end
|
||||
end
|
||||
end, true)
|
||||
end, opts)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
local fn = vim.fn
|
||||
local utils = require "nvim-treesitter.utils"
|
||||
local uv = vim.uv or vim.loop
|
||||
|
||||
-- Convert path for cmd.exe on Windows.
|
||||
-- This is needed when vim.opt.shellslash is in use.
|
||||
@ -303,10 +304,11 @@ function M.select_download_commands(repo, project_name, cache_folder, revision,
|
||||
"GIT_PREFIX",
|
||||
"GIT_WORK_TREE",
|
||||
} do
|
||||
if vim.uv.os_getenv(k) then
|
||||
if uv.os_getenv(k) then
|
||||
vim.api.nvim_err_writeln(
|
||||
string.format(
|
||||
"Cannot install %s with git in an active git session. Exit the session and run ':TSInstall %s' manually",
|
||||
project_name,
|
||||
project_name
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user