MaxMEllon / vim-jsx-pretty

:flashlight: [Vim script] JSX and TSX syntax pretty highlighting for vim.
MIT License
969 stars 38 forks source link

Highlighting fails #122

Closed alexseitsinger closed 4 years ago

alexseitsinger commented 4 years ago

Greetings,

It appears that syntax highlighting fails for portions of a .tsx file when a needed ReturnType is inserted into an arrow function. Also, when operating on a .tsx file, object destructuring fails to be syntax highlighted as it is with .jsx files.

I have previous tried disabling each plugin and re-enabling them individually with no success.

To me, it appears like adding the ReturnType causes VIM to interpret the proceeding code as a syntax error? I'm not too sure.

When it does get highlighted correctly, page-up or page-down on the module file will cause the code after the entered ReturnType to be highlighted in green (matching the highlight color of the ReturnType (eg: {(): ReactElement => { most of code in here gets highlighted green }}).

Also, syntax highlighting within objects (eg: css={{ height: "100%" }}) doesn't work at all.

Editor: Neovim v0.3.8 Colorscheme: Gruvbox FIletype: typescript.tsx Plugins (for TypeScript/JavaScript):

  1. yuezk/vim-js
  2. HerringtonDarkholme/yats.vim
  3. maxmellon/vim-jsx-pretty
  4. pangloss/vim-javascript
  5. styled-components/vim-styled-components
yuezk commented 4 years ago

@alexseitsinger Could you provide the code snippets and screenshots if possible?

alexseitsinger commented 4 years ago

No syntax highlight for props (with/without parameters): object-destructuring-no-syntax-highlight

Syntax highlighting is all green (using this component). (with/without parameters): syntax-highlight-all-green

I've only recently begun to adopt TypeScript, so it is possible that I'm doing something wrong, leading to incorrect highlighting...

Thanks for your time.

alexseitsinger commented 4 years ago

After further investigation, it appears this issue may be connected to limitations of the 'HerringtonDarkholme/yats.vim' plugin.