fix(vue): different comment strings for JS and HTML sections
Vue files contain also Javascript
Description
Inside Vue files you normally have
<script>
// Javasciript
</script>
<template>
<!-- HTML -->
</template>
The first time you try to comment a line inside the <script> tag, it will be properly commented with //.
But when you try to uncomment it it will result in <!-- // %s -->.
By specifying the script Treesitter node, now Javascript code is always handled correcly inside Vue files.
Related Issue(s)
I didn't open one since I thought it was easier to just fix the problem
This PR is stale because it has been open 30 days with no activity.
:cry:
I'm having the same issue. Would be great to see this merged
I also ran into this problem. I've inserted the fix from @ignamartinoli manually in my config and can confirm that it works:
return {
"folke/ts-comments.nvim",
opts = {
lang = {
vue = {
"<!-- %s -->",
script_element = "// %s",
},
},
},
event = "VeryLazy",
enabled = vim.fn.has("nvim-0.10.0") == 1,
}
Would be nice if this could be merged as a default
This PR is stale because it has been open 30 days with no activity.
The issue appears solved now. I suspect due to some improvement on Treesitter