Closed bachirelkhoury closed 7 months ago
Hey! Sorry to hear that you're having problems. Here are a couple things you could try:
enable_autocmd
command to false
: {
'JoosepAlviste/nvim-ts-context-commentstring',
opts = {
enable_autocmd = false,
},
},
I doubt that this would fix the issue, but it at least makes sure to call the setup
function and does not set up the autocmd
on CursorHold
.
:TSInstall vue
and :TSInstall typescript
):=require('ts_context_commentstring').calculate_commentstring()
return in the TypeScript block? It should return // %s
pre_hook
to make sure that it's actually called: { 'numToStr/Comment.nvim',
config = function()
require('Comment').setup {
pre_hook = function()
vim.print('hello')
return 'hehe %s'
end,
}
end,
},
Maybe some of those things help to figure out what's going wrong.
Thanks for your prompt response and help @JoosepAlviste!
I was missing Treesitter vue parser.
:TSInstall vue
has indeed fixed the issue. Not sure how I've managed working with vue for so long without having that parser...
require('nvim-treesitter.configs').setup {
ensure_installed = { ... 'javascript', 'typescript', 'vue' },
}
thanks again for your help and great plugin!
Minimal reproducible full config
Description
When commenting inside the script tag, a html comment tags
<!-- -->
are being used instead of//
Steps to reproduce
I can see in the animated gif in the repo that you are successfully doing that in a vue file, but I haven't been able to do so.
Expected behavior
I expected the ts/js section to use valid comments.
Actual behavior
Typescript and javascript section is treated as html and getting commented with
<!-- -->
Additional context
No response