felipeochoa / rjsx-mode

A JSX major mode for Emacs
https://github.com/felipeochoa/rjsx-mode
MIT License
641 stars 32 forks source link

Attempting to use electric with > only works after waiting #132

Closed SkyLeite closed 2 years ago

SkyLeite commented 2 years ago

Hi. Thank you for this great package.

In a JSX context, immediately typing <b> for example results in <b>/> as opposed to <b></b>. To get the desired result, I have to type <b, wait for half a second or so, and then type >.

Please see the following clip:

https://user-images.githubusercontent.com/16887983/149504662-378b5d1b-906a-4b03-9bb7-f551839ecaef.mp4

felipeochoa commented 2 years ago

Unfortunately this is an intrinsic limitation of how this package is built (based on js2). The buffer must be parsed in to an AST, which is only run after a short pause in input. Depending on the size of your buffer and the speed of your machine, that pause is more/less noticeable.