-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax highlighting breaks inside typescript files when type casting #114
Comments
Thanks for your reporting. This is a known issue and it's difficult to fix, but I'll try it later. |
@pbondoer For now, I recommend you to use the const foo = bar as string https://www.typescriptlang.org/docs/handbook/jsx.html#the-as-operator |
I looked into peitalin/vim-jsx-typescript#21 However, I've chosen to use that plugin instead for now, as Perhaps it should be considered doing the same, as it seems the extension is required, as per TypeScript docs. |
@pbondoer I came up with a solution for this issue, you can update this plugin and test it. For the extension problem, I will update it soon. |
@yuezk It seems to work on my simple test case and on complex files that used to have issues. I'll let you know if anything weird pops up. However, brackets are not getting any highlight. Though I'm willing to live with that: Thank you! ❤️ |
I noticed that and just committed a change, you can update it again. |
@yuezk It now highlights |
@pbondoer Added the highlight for brackets. Update it again. |
Seems to work good on a large test file! I'll close this issue. Feel free to re-open if needed 🎉 |
When using
<Foo>bar
type casts, syntax highlighting and indentation completely break.I initially thought this might be an issue with
typescript-vim
but upon further investigation I can confirm this only happens when bothvim-jsx-pretty
andtypescript-vim
are enabled.Minimal
.vimrc
to reproduce (withvim-plug
)Additional discussion
See leafgarland/typescript-vim#134 for previous discussion which prompted me to create this issue.
Please let me know if I'm missing something obvious or if you need any extra info 👍
The text was updated successfully, but these errors were encountered: