Open JoosepAlviste opened 9 months ago
The minimum Neovim version for this plugin is now version 0.9: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/commit/34ff1fa0abd0f5d0a595025a3c6808630e737fcf
Update to Neovim version 0.9
Usage as a nvim-treesitter
module has been deprecated: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/pull/80. Configuration as a nvim-treesitter
module configuration will still work, but you should see a message notifying you of the deprecation. It will be removed some time in the future (unsure when, probably in a couple months).
The plugin is set up automatically now.
This also increases the minimal Neovim version to 0.9.4.
Upgrade your Neovim version to at least 0.9.4.
If you're using the default configuration, then just delete the nvim-treesitter
module configuration:
Before:
require('nvim-treesitter.configs').setup {
context_commentstring = {
enable = true,
},
}
After:
require('nvim-treesitter.configs').setup {}
-- nvim-ts-context-commentstring is set up automatically
If you're using any custom configuration, then use require('ts_context_commentstring').setup
:
Before:
require('nvim-treesitter.configs').setup {
context_commentstring = {
enable = true,
enable_autocmd = false,
-- or "config" if you're still using the old configuration key
languages = {
typescript = '// %s',
},
},
}
After:
require('ts_context_commentstring').setup {
enable_autocmd = false,
languages = {
typescript = '// %s',
},
}
This does not work for me after the migration, I get //
comments in jsx.
My config looks like this:
require('nvim-treesitter.configs').setup {}
Hey @marcelarie! Could you create an issue with a minimal config? Also, what version of Neovim are you using (0.9.4+ is required)?
@JoosepAlviste hey sorry for the late reply, I will check it soon and try to find the issue. Thanks!
The c
language single-line commentstring
configuration has changed to match the Vim default of /* %s */
(https://github.com/JoosepAlviste/nvim-ts-context-commentstring/pull/85). Here's how to get the same behavior as before:
require('ts_context_commentstring').setup {
languages = {
c = { __default = '// %s', __multiline = '/* %s */' },
},
}
The comments of this issue will include all breaking changes together with migration guides.
Please open a separate issue if there are any issues following the migration guides. I'd like to keep this thread clean so that it would be easy to find information for everyone.