JoosepAlviste / nvim-ts-context-commentstring

Neovim treesitter plugin for setting the commentstring based on the cursor location in a file.
MIT License
1.18k stars 35 forks source link

context_commentstring nvim-treesitter module is deprecated #91

Open mr-scrpt opened 12 months ago

mr-scrpt commented 12 months ago

Minimal reproducible full config

return {
    "numToStr/Comment.nvim",
    event = { "BufReadPre", "BufNewFile" },
    dependencies = {
        "nvim-treesitter/nvim-treesitter",
        "JoosepAlviste/nvim-ts-context-commentstring",
    },
    config = function()
        local comment = require("Comment")

        -- enable comment
        comment.setup({
            -- for commenting tsx and jsx files
            -- pre_hook = ts_context_commentstring.create_pre_hook(),
            pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
        })
    end,
}

Description

I updated all the nvim modules today and started getting this error

context_commentstring nvim-treesitter module is deprecated, use require('ts_context_commentstring').setup {} and set vim.g.skip_ts_context_commentstring_module = true to speed up loading instead.
This feature will be removed in ts_context_commentstring version in the future

Steps to reproduce

I just run nvim and open any file.

Expected behavior

Just work

Actual behavior

not work

Additional context

No response

thelazyoxymoron commented 12 months ago

Required changes documented here: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/issues/82

JoosepAlviste commented 12 months ago

Added a link to the breaking changes issue to the deprecation message: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/commit/1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee

Hopefully that makes it easier to find the migration guide.

PS: Thanks @thelazyoxymoron for providing the link 🙏