vim-jsx icon indicating copy to clipboard operation
vim-jsx copied to clipboard

Support Fragment Syntax

Open clemmy opened this issue 7 years ago • 10 comments

Fragment syntax has been added to JSX which looks something like

<>I'm a fragment!</>

The spec PR is here: https://github.com/facebook/jsx/pull/93.

clemmy avatar Nov 28 '17 14:11 clemmy

I have started looking at it, but I'm not a Vimscript buff. The start of jsxRegion must be altered so that The contents are optional

Changing this:

  \ start=+\%(<\|\w\)\@<!<\z([a-zA-Z_][a-zA-Z0-9:\-.]*\>[:,]\@!\)\([^>]*>(\)\@!+

to this:

  \ start=+\%(<\(\|\w\)\@<!<\z([a-zA-Z_][a-zA-Z0-9:\-.]*\>[:,]\@!\)\([^>]*\)\?>(\)\@!+

is a start. But it triggers xmlError in the syntax.

adrianhelvik avatar Oct 17 '18 09:10 adrianhelvik

This other Vim jsx plugin added support for this recently: https://github.com/neoclide/vim-jsx-improve/issues/40

Not sure if their implementation would help or not. Would be great to have this feature added

asgeo1 avatar Dec 13 '18 10:12 asgeo1

Anyone on this atm? The syntax highlighting becomes pretty freaky as soon as React Fragment are present.

t-mdo avatar Jan 23 '19 09:01 t-mdo

I have a fix for this. PR incoming.

amadeus avatar Feb 19 '19 02:02 amadeus

Since this repo appears abandoned, I have forked it and fixed this issue:

amadeus/vim-jsx

I've also merged in a few of the open PRs from here. Feel free to give it a try.

amadeus avatar Feb 25 '19 03:02 amadeus

@amadeus Awesome, thanks!

TrySound avatar Feb 25 '19 08:02 TrySound

@amadeus Starred and installed! :)

adrianhelvik avatar Feb 25 '19 14:02 adrianhelvik

Thank you @amadeus - Starred and installed.

marcolz avatar Feb 25 '19 17:02 marcolz

@amadeus Thank you very much (y)

Lpaydat avatar May 15 '19 10:05 Lpaydat

@amadeus Thanks!

csakai avatar Jun 01 '19 23:06 csakai