mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 411 forks source link

Object lookup in JSX className expression #436

Closed srounce closed 5 years ago

srounce commented 5 years ago

What is wrong

Cannot address sub-keys via JSX className (element.{object.className}) in the same way we are with attributes.

(Works) Value:

%div.{cssModuleClassName}

yields

<div className={cssModuleClassName}></div>

(Works) Object lookup in attributes

%div[className={styles.cssModuleClassName}]

yields

<div className={styles.cssModuleClassName}></div>

(Doesn't work) Object lookup in className

%div.{styles.cssModuleClassName}

yields

<div className="{styles cssModuleClassName"></div>

expected

<div className={styles.cssModuleClassName}></div>
mattn commented 5 years ago

Could you please add what is wrong in description?

srounce commented 5 years ago

Could you please add what is wrong in description?

Ugh didn't realise I'd overwritten the post intro.

srounce commented 5 years ago

I don't think this is fixed.

I tried the latest version and current behaviour is as follows:

%div.{styles.lolwut}

yields:

<div className={styles lolwut}></div>

expected:

<div className={styles.lolwut}></div>
mattn commented 5 years ago

Which editor works with such behavior?

srounce commented 5 years ago

I'm using (neo)vim. I only use emmet-vim so I don't know if any other zencoding/emmet-like plugins (for vim or other editors) implement this behaviour correctly for JSX classNames.