Skip to content
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

fix: don't use deprecated query.get_node_text() call #1067

Merged
merged 1 commit into from
Sep 23, 2023
Merged

fix: don't use deprecated query.get_node_text() call #1067

merged 1 commit into from
Sep 23, 2023

Conversation

linguini1
Copy link
Contributor

When I entered presenter mode in Neorg, I would receive a deprecation warning about vim.treesitter.query.get_node_text,
along with a suggestion to replace it with vim.treesitter.get_node_text. This PR does exactly that and only that.

…ode_text to prevent deprecation warning message when entering presenter mode.
@linguini1
Copy link
Contributor Author

Seems like the failing lint check is not due to my changes. Unless I need to fix it to be merged, I will leave it be.

@vhyrro
Copy link
Member

vhyrro commented Sep 15, 2023

Whoa, this is odd. What Neovim version are you running? The nvim-treesitter crew literally just deprecated get_node_text in favour of query.get_node_text, did they re-deprecate query.get_node_text? I'd be surprised :p

@linguini1
Copy link
Contributor Author

linguini1 commented Sep 15, 2023

Whoa, this is odd. What Neovim version are you running? The nvim-treesitter crew literally just deprecated get_node_text in favour of query.get_node_text, did they re-deprecate query.get_node_text? I'd be surprised :p

That is odd, I didn't know about this. I'm running the latest (might be a few days old) nightly of NVIM v0.10.0-dev-1031+gc431d820e (as the contribution guideline prescribes), and below is a screenshot of the error message I receive entering presentation mode. It seems to say that they are in fact deprecating query.get_node_text in favour of vim.treesitter.get_node_text().

deprecation error

@max397574
Copy link
Contributor

that's really odd
this isn't a really recent change so I don't remember it unfortunately
but in general in all the discussion they try to move function into modules and not "up" like this deprecation would do it

@vhyrro
Copy link
Member

vhyrro commented Sep 18, 2023

Update: I've had no time to actually test this out on my end yet which is why it's taking so long to commit. I should have some spare time tomorrow!

@vhyrro
Copy link
Member

vhyrro commented Sep 23, 2023

Wow they deprecated quite a few things actually, I'll make patches for the other deprecated functions too. Thank you for the PR and sorry for the wait!

@vhyrro vhyrro changed the title Replace deprecated get_node_text() call. fix: don't use deprecated query.get_node_text() call Sep 23, 2023
@vhyrro vhyrro merged commit 7248c34 into nvim-neorg:main Sep 23, 2023
1 check failed
@linguini1
Copy link
Contributor Author

Wow they deprecated quite a few things actually, I'll make patches for the other deprecated functions too. Thank you for the PR and sorry for the wait!

No need to apologize! Happy to help.

benlubas pushed a commit to benlubas/neorg that referenced this pull request Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants