-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"LanguageTree:for_each_child() is deprecated, use LanguageTree:children() instead." #1104
Comments
this issue will occur to anyone using a relatively new neovim-nightly. There is no replacement function for this one which actually makes things easier because we don't have to check if a new function exists. There are some examples of how this function can be replaced in the pr which deprecated it. I just haven't found the time to do that yet. |
Treesitters `for_each_child()` will be deprecated in 0.11. It ias encouraged to use `children()` and implement the recursion yourself. We use a loop to iterate over the tree's children and call the usual function for each child. fixes nvim-neorg#1104
This has since been fixed in the latest commit, check it out! :) |
Prerequisites
Neovim Version
NVIM v0.10.0-dev-5f4f83b
Neorg setup
{
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = { "nvim-lua/plenary.nvim", { "laher/neorg-exec" } },
config = function()
require("neorg").setup({
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.concealer"] = {
config = {
icons = {
todo = {
urgent = {
icon = "!",
},
},
},
},
}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/notes",
diary = "/mnt/crypt/diary",
},
default_workspace = "notes",
},
},
["core.ui.calendar"] = {
config = {
strategy = "nested",
},
},
["core.esupports.metagen"] = {
config = {
template = {
{
"title",
function()
return vim.fn.expand("%:t:r")
end,
},
{ "description", "" },
{
"authors",
function()
return vim.fn.getenv("USER")
end,
},
{ "categories", "" },
{
"created",
function()
return os.date("%Y-%m-%d %H:%M %z")
end,
},
{
"updated",
function()
return os.date("%Y-%m-%d %H:%M %z")
end,
},
},
},
},
["external.exec"] = {},
},
})
end,
},
Actual behavior
Upon saving a file with any metadata in it, these two warnings appear:
This feature will be removed in Nvim version 0.11
...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:466: in function 'for_each_child'
...eorg/lua/neorg/modules/core/esupports/metagen/module.lua:248: in function 'update_metadata'
...eorg/lua/neorg/modules/core/esupports/metagen/module.lua:338: in function <...eorg/lua/neorg/modules/core/esupports/metagen/module.lua:337>
Since this is a deprecation warning, it doesn't seem to affect the functionality for now.
Expected behavior
I expected to see no such warnings.
Steps to reproduce
Neorg inject-metadata
Potentially conflicting plugins
No response
Other information
It seems that these warnings only occur in the metagen module. While I do have a custom template, it shouldn't affect the presence of the warning in any way.
Not sure if this is really a bug, since the plugin still works, but I didn't see anyone mention this issue before.
Help
None
Implementation help
No response
The text was updated successfully, but these errors were encountered: