nvim-ts-context-commentstring icon indicating copy to clipboard operation
nvim-ts-context-commentstring copied to clipboard

BREAKING CHANGES

Open JoosepAlviste opened this issue 2 years ago • 6 comments

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.

JoosepAlviste avatar Nov 18 '23 19:11 JoosepAlviste

The minimum Neovim version for this plugin is now version 0.9: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/commit/34ff1fa0abd0f5d0a595025a3c6808630e737fcf

Migration guide

Update to Neovim version 0.9

JoosepAlviste avatar Nov 18 '23 19:11 JoosepAlviste

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.

Migration guide

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',
  },
}

JoosepAlviste avatar Nov 18 '23 21:11 JoosepAlviste

This does not work for me after the migration, I get // comments in jsx.

My config looks like this:

require('nvim-treesitter.configs').setup {}

marcelarie avatar Nov 21 '23 12:11 marcelarie

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 avatar Nov 21 '23 15:11 JoosepAlviste

@JoosepAlviste hey sorry for the late reply, I will check it soon and try to find the issue. Thanks!

marcelarie avatar Nov 22 '23 16:11 marcelarie

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 */' },
  },
}

JoosepAlviste avatar Jul 08 '24 12:07 JoosepAlviste