Closed t18n closed 3 months ago
This issue may be related: https://github.com/neovim/neovim/issues/24531
Can't reproduce this. Your repro is also far from minimal and setup ts-comments twice
@folke I apologize for the minimal code, I overlooked it and the existing ts-comment.
I have recorded my issue here. You can see the file type in the bottom right lualine. https://github.com/folke/ts-comments.nvim/assets/14198542/27df4a37-db5a-402e-a845-e38c118ad3b7
What does your tsx
file return when you run :set filetype?
?
$ nvim -u repro.lua foo.tsx
Steps:
gcc
Since the repro works just fine, there's something else wrong with your installation. Are you using either stable or a recent nightly?
Thanks @folke! I use the stable version from homebrew
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info
I ran the repro as you showed and it worked correctly on my machine too, so I bet tha my installation is the problem. The repro filetype is also typescript
react. Hmm, weird! Anything on top of your mind that you can think of?
So, turns out I am an idiot. I had been using comment.nvim
prior to 0.10.0 for commenting. Then I upgraded to the latest version and using ts-comment
while forgetting to delete comment.nvim
. Now I deleted and it works perfectly. Thank you for your help and the awesome plugin @folke.
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.10.0
Operating system/version
Mac OS 14.4.1 (23E224)
Describe the bug
I've verified with Lazy and the plugin is installed properly. However, when I use it inside my
tsx
andjsx
files, they don't work at all. All the element comments just added// %s
. I used the command:set filetype?
to and and they returnsjavascriptreact
andtypescriptreact
as the filetype instead, so I suspect that this is the issue.Steps To Reproduce
folke/ts-comments.nvim
tsx
file and check:set filetype?
if it istypescriptreact
Expected Behavior
Go to a React element and toggle comment should respect
{/* %s */}
formatRepro