smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Can't wrap JSX in `{` `}`

Open tien opened this issue 2 years ago • 1 comments

Expected behavior

// Be able to select the inner div and wrap it in  {}
<div>
  <div />
</div>

// Which will become
<div>
  {<div />}
</div>

// This is useful when doing something like this
<div>
  {somePredicate && <div />}
</div>

Actual behavior

Receive the following error

mismatch sexp state: wrapping would break structure

Environment & version information

  • smartparens version: <Please specify manually>
  • Active major-mode: typescript-tsx-mode
  • Smartparens strict mode: nil
  • Emacs version (M-x emacs-version): GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2023-02-23
  • Starterkit/Distribution: Doom
  • OS: darwin

tien avatar Jul 22 '23 11:07 tien

Where does the typescript-tsx-mode come from? I'm using the regular typescript-mode and it wraps.

Fuco1 avatar Nov 02 '23 08:11 Fuco1