-
Notifications
You must be signed in to change notification settings - Fork 143
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
highlighting not working for ts tsx files #158
Comments
Also, I tried disabling all the other plugins. It doesn't help. File is being recognised as typescript or typescript.jsx. If I type |
@alanbo It doesn't work for me neither. And python / javascript works as well. |
Did you manage to figure it out? I'm having same issue with JSX (regular stuff seems to be coloured to some extent) |
In general you can tell Vim to recognize files ending in set filetype=typescript in the buffer, or adding this to your augroup SyntaxSettings
autocmd!
autocmd BufNewFile,BufRead *.tsx set filetype=typescript
augroup END |
This brings a new problem. Typescript language server excepts from a typescript file to not have JSX in it. Which means that |
Instead use peitalin/vim-jsx-typescript library for jsx highlighting, it seem to work well along with |
I am also having the same issue. All other files work as expected but ts files show only the neovim default syntax Neovim Version
|
For anyone who stumbled upon this from google, here's the snippet i found that makes typescriptreact work " inside vim-plug or your plugin manager
Plug 'peitalin/vim-jsx-typescript'
" make it so that tsx files use ts syntax highlighting, while the jsx plugin handles the jsx parts
augroup twig_ft
au!
autocmd BufNewFile,BufRead *.tsx set syntax=typescript
augroup END This sets the syntax highlighting of .tsx files to that of regular typescript's. |
From the Changelog: filetypes were updated from typescript.tsx to typescriptreact Please set filetypes as typescriptreact, not typescript.tsx as in prior versions in your .vimrc if you have any issues So the following fixed it for me:
|
I have the following .vimrc and all the plugins are installed:
The syntax highlighting for ts and tsx files doesn't work.
Is it the issue with the plugin? or some of the settings are wrong?
The text was updated successfully, but these errors were encountered: