react-emmet
react-emmet copied to clipboard
Add support for nesting operators
## Description
This is a follow-up for #3. Emmet supports different kinds of Nesting operators. It would be a match made in heaven to have this supported in this vs code extension as well!
Specification
Child: >
fc.MyComponent>useState.firstName
would produce:
const MyComponent = () => {
const [firstName, setFirstName] = useState();
return (
<></>
);
}
Sibling: +
fc.MyComponent>useState.firstName+useState.lastName
would produce:
const MyComponent = () => {
const [firstName, setFirstName] = useState();
const [lastName, setLastName] = useState();
return (
<></>
);
}
Climb-up: ^
fc.MyComponent>useState.firstName^fc.AnotherComponent
would produce:
const MyComponent = () => {
const [firstName, setFirstName] = useState();
return (
<></>
);
}
const AnotherComponent = () => {
return (
<></>
);
}
Also note, looking through the code base the approach would certainly need to be different. I think this feature would require to move away from using Regex as a parser and move to an actual language parser.