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: handle context-commentstring setup #4451

Merged

Conversation

olrtg
Copy link
Contributor

@olrtg olrtg commented Dec 26, 2023

Description

This PR fixes a deprecation warning from the JoosepAlviste/nvim-ts-context-commentstring plugin.

Screenshot 2023-12-26 at 09 40 36

This has been done following the migration steps mentioned in JoosepAlviste/nvim-ts-context-commentstring#82 (comment).

The changes are internal to the setup function, and no further action is required from the user.

All the options under lvim.builtin.treesitter.context_commentstring will be directly passed to require('ts_context_commentstring').setup()

With these changes, we're removing the possibility of customizing the plugin using the lvim.builtin.treesitter table. So users won't be able to add more languages to the table for example (but I don't know if that's something users usually do). So yes, in theory this is a breaking change.

How Has This Been Tested?

comment out these two lines in lua/lvim/core/treesitter.lua to trigger the deprecation warning

  ts_context_commentstring.setup(opts.context_commentstring)
  opts.context_commentstring = nil

@olrtg
Copy link
Contributor Author

olrtg commented Dec 26, 2023

@kylo252 @LostNeophyte I have a few more questions before marking this as ready for review... Should we allow the users to customize this plugin through a table? (for example lvim.builtin.commentstring.languages = { ... }) or that's not necessary? And another thing, I don't really know how this plugin gets triggered, so testing for me was kind of unreliable. Do you have more info about how this plugin works with lunarvim and comment.nvim so I can write some reproducible steps for you guys to test this?

@kylo252
Copy link
Collaborator

kylo252 commented Jan 11, 2024

sorry for the delay, we should preferably handle the deprecation gracefully.

@olrtg
Copy link
Contributor Author

olrtg commented Jan 11, 2024

Hey @kylo252! no worries, all good. What do you mean by that? Is there a way to do that?

@kylo252
Copy link
Collaborator

kylo252 commented Jan 11, 2024

Hey @kylo252! no worries, all good. What do you mean by that? Is there a way to do that?

check the deprecation handler: https://github.com/LunarVim/LunarVim/blob/master/lua%2Flvim%2Fconfig%2F_deprecated.lua#L20

@olrtg
Copy link
Contributor Author

olrtg commented Jan 11, 2024

Oh! I see.. well I'll try to take a look at that later then.

@kylo252 kylo252 linked an issue Jan 17, 2024 that may be closed by this pull request
@kylo252
Copy link
Collaborator

kylo252 commented Jan 17, 2024

This also increases the minimal Neovim version to 0.9.4.

I just noticed that this requires a version bump

@olrtg
Copy link
Contributor Author

olrtg commented Jan 17, 2024

@kylo252 added the deprecation message. About the version bump, should I change that somewhere?

Also, let me know if there's something else to do on my end.

@olrtg olrtg marked this pull request as ready for review January 17, 2024 22:04
@kylo252 kylo252 force-pushed the context-commentstring-deprecation-notice branch from f7b4410 to ffc683e Compare May 13, 2024 09:31
@kylo252 kylo252 changed the title fix(context-commentstring): deprecation notice fix: handle context-commentstring setup May 13, 2024
@kylo252
Copy link
Collaborator

kylo252 commented May 13, 2024

I simplified the process:

The changes are internal to the setup function, and no further action is required from the user.
All the options under lvim.builtin.treesitter.context_commentstring will be directly passed to require('ts_context_commentstring').setup()

@kylo252 kylo252 requested a review from abzcoding May 13, 2024 09:40
@kylo252 kylo252 force-pushed the context-commentstring-deprecation-notice branch from ffc683e to 45aea10 Compare May 13, 2024 09:41
@kylo252 kylo252 merged commit 38216e6 into LunarVim:master May 14, 2024
8 checks passed
@olrtg olrtg deleted the context-commentstring-deprecation-notice branch May 14, 2024 12:42
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.

error: context_commentstring nvim-treesitter module is deprecated
4 participants