Skip to content
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

Support Fragment Syntax #152

Open
clemmy opened this issue Nov 28, 2017 · 10 comments · May be fixed by #188
Open

Support Fragment Syntax #152

clemmy opened this issue Nov 28, 2017 · 10 comments · May be fixed by #188

Comments

@clemmy
Copy link

clemmy commented Nov 28, 2017

Fragment syntax has been added to JSX which looks something like

<>I'm a fragment!</>

The spec PR is here: facebook/jsx#93.

@adrianhelvik
Copy link

adrianhelvik commented Oct 17, 2018

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.

@asgeo1
Copy link

asgeo1 commented Dec 13, 2018

This other Vim jsx plugin added support for this recently: neoclide/vim-jsx-improve#40

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

@t-mdo
Copy link

t-mdo commented Jan 23, 2019

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

@amadeus
Copy link

amadeus commented Feb 19, 2019

I have a fix for this. PR incoming.

@amadeus amadeus linked a pull request Feb 19, 2019 that will close this issue
@amadeus
Copy link

amadeus commented Feb 25, 2019

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.

@TrySound
Copy link

@amadeus Awesome, thanks!

@adrianhelvik
Copy link

@amadeus Starred and installed! :)

@marcolz
Copy link

marcolz commented Feb 25, 2019

Thank you @amadeus - Starred and installed.

@Lpaydat
Copy link

Lpaydat commented May 15, 2019

@amadeus Thank you very much (y)

@csakai
Copy link

csakai commented Jun 1, 2019

@amadeus Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants