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

Doesn't work ootb with mini.comment / Comment.nvim (React) #99

Open
StitiFatah opened this issue Mar 16, 2024 · 0 comments
Open

Doesn't work ootb with mini.comment / Comment.nvim (React) #99

StitiFatah opened this issue Mar 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@StitiFatah
Copy link

StitiFatah commented Mar 16, 2024

Minimal reproducible full config

https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua + add 'JoosepAlviste/nvim-ts-context-commentstring' inside require('lazy').setup({})

Description

The README says that it works ootb, I tried with comment.nvim and mini.comment and it didn't. I had to add this configuration to mini.comment :

{
  "echasnovski/mini.comment",
  event = "VeryLazy",
  opts = {
    options = {
      custom_commentstring = function()
        return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
      end,
    },
  },
}

and this to comment.nvim :

return {
  'numToStr/Comment.nvim',
  lazy = false,
  config = function()
    require('Comment').setup {
      pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(),
    }
  end,
}

Steps to reproduce

  • clone this repo where you want the config to be https://github.com/nvim-lua/kickstart.nvim
  • add 'JoosepAlviste/nvim-ts-context-commentstring' to require('lazy').setup({})
  • See that commenting random React's jsx in a .tsx file just adds the classic js //

Expected behavior

Should work ootb as per the README

Actual behavior

Doesn't work ootb

@StitiFatah StitiFatah added the bug Something isn't working label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant