Revert "bugfix: crashing treesitter"

This reverts commit d24946e94b.
This commit is contained in:
Ivar Fatland
2026-04-18 18:34:21 +02:00
parent 33ce9addb4
commit 6d974cff46
@@ -133,16 +133,13 @@ end, opts)
---@param pred string[] ---@param pred string[]
---@return boolean|nil ---@return boolean|nil
query.add_directive("set-lang-from-info-string!", function(match, _, bufnr, pred, metadata) query.add_directive("set-lang-from-info-string!", function(match, _, bufnr, pred, metadata)
local capture_id = pred[2] local capture_id = pred[2]
local node = match[capture_id] local node = match[capture_id]
if not node then if not node then
return return
end end
if not node.range then local injection_alias = vim.treesitter.get_node_text(node, bufnr):lower()
return -- TODO: What is goin on here??? metadata["injection.language"] = get_parser_from_markdown_info_string(injection_alias)
end
local injection_alias = vim.treesitter.get_node_text(node, bufnr):lower()
metadata["injection.language"] = get_parser_from_markdown_info_string(injection_alias)
end, opts) end, opts)
-- Just avoid some annoying warnings for this directive -- Just avoid some annoying warnings for this directive