Open ericwooley opened 8 years ago
yes it does, what does your filetype
in vim read when you open a tsx file?
:set ft
Hmm, yeah I can't get this to work either. The dependency is on leafgarland/typescript-vim
, correct? It's really just a copy of mxw/vim-jsx
(with different syntax selectors), which works fine for me, including correct indentation and commenting
the dependency is on typescript-vim. @indiesquidge does anything change when you switch the plugin ordering?
@ianks, good question, I hadn't considered that. Unfortunately, after trying both orders, nothing changed and the plugin still won't work 😕
Are all your plugins up to date?
Yeah
This all works for you seamlessly? Commenting, indentation, highlighting? Everything just how it does in a .jsx
file with mxw/vim-jsx
?
Yes it does.
are you in a *.tsx file? can you paste the output of :set ft
in from a tsx buffer?
I looked in your dotfiles, this line is causing it not to work:
autocmd BufRead,BufNewFile *.tsx setlocal filetype=typescript
setting the FT is done by this plugin, and it should be typescript.tsx
Ah, that's an old line that's been removed locally for a bit now. Doesn't seem to be the cause of the issue still though.
Strangely, even without that line, my filetype is still set to typescript
. If I manually set it it to typescript.tsx
, some problems are solved! Syntax highlighting will show up correctly and indentation works as expected. However, commenting lines out still acts like it's a TypeScript comment (// ...
) rather than a TSX comment ({/* ... */}
)
Does that work on vim-jsx?
The commenting feature? Yeah, it works. I'm wondering what's keeping my filetype from being set correctly now. I have nothing left in my dotfiles that explicitly sets any filetypes, so I would think the plugin's setter would work 😖
do you use https://github.com/Quramy/tsuquyomi ?
Ha, yeah, that's the issue. Looks like ianks/vim-tsx
must come after Quramy/tsuquyomi
. I'm feeling like I should bring it to Quramy
's attention that his plugin is causing conflicts with something that is meant to work with .tsx
files.
yeah, a pr to them setting the ft to typescript.tsx should be backwards compatible, if someone were to make that pr :wink:
Looks like leafgarland/typescript-vim
sets this as well. Two PRs!
Note that this is even an issue between mxw/vim-jsx
and pangloss/vim-javascript
.
I have put this plugin after all the other named plugins. Everything works great but the brackets. Can you recreate this?
It also doesn't check for quote escapes within the code.
@brene I think it actually has to do with arrow functions:
I do not have to time right now to try to debug this, however.
It definitely does not indent properly:
Before adding:
After adding:
I tried installing it, can't seem to get it to work right. I am also using syntastic if that matters.