vim-context-commentstring
vim-context-commentstring copied to clipboard
Improve Typescript React support
I use vim-coc and looks like it sets filetype typescriptreact for tsx files. Anyways I'm keeping previous functionality just in case somebody used it. For my current setup the implementation is much simple.
let g:context#commentstring#table['typescriptreact'] = {
\ 'tsxRegion': '{/*%s*/}'
\}
👋
Hi.
Thank you for the patch, and sorry for not replying before. I don't use vim so heavily nowadays, and certainly I don't do HTML stuff, pretty much at all. I wasn't already confident with the patch I accepted before, and even less with this one (because I don't know how to test it, and I'm quite confused with the technologies).
Do you mind if I ask you a few questions? It's fine if you don't know them all.
- You added support for a new file type, but did the others need change, or you did so as a cleanup?
- Is there any difference between typescript.tsx and typescript.jsx?
- What's different between typescriptreact and the others? Why you only need one syntax region?
Thank you.
While this can't be merged now due to the conflicts (I've pushed some changes), let me know which syntax highlighting are using, and I'll look into fixing this myself if you don't find the time.
I'm struggling to find out which syntaxes might be the most popular ones to ship defaults here. Although I'm also considering that I should leave this to users to extend themselves in their config (it's just a line of code to extend the variable), because if there are too many different options, it's just not going to work well. Each user will need to adjust to their syntax.
Sorry. I have seen your message but had no time to immediately respond. The different file types for Javascript/Typescript react files come from different plugins users can install for Typescript support.
Like:
sheerun/vim-polyglot
leafgarland/typescript-vim
dense-analysis/ale
neoclide/coc.nvim
I used different combinations so you can track changes in my previous PR. It would be nice to have some simple solution however many people can use different setups.