emmet icon indicating copy to clipboard operation
emmet copied to clipboard

WIP: feat: adds `frag` snippet

Open wavilikhin opened this issue 1 year ago • 2 comments

fixes #735

🚧 This PR is not ready yet

Resolves to React.Fragment shorthand <></>

wavilikhin avatar Dec 15 '24 14:12 wavilikhin

This PR requires additional improvements:

  • You should check the output with nested elements, like frag>ul>litems*4. Note that the output should be properly formatted
  • Also check how “Wrap with abbreviation” action works if user wants to wrap existing contents with frag snippet (see unit tests for example)

sergeche avatar Dec 16 '24 08:12 sergeche

@sergeche Hey! I didn't see a CONTRIBUTING.md guide (I could help create one if needed) so I created this branch and marked it as WIP to show that some work is in progress. Its defineitely not ready yet.

Thanks for the comments! I'll expand the test coverage to cover all possible cases for sure. I'm still in the process of understanding what's going on here in general. For now, I've created a separate test/frag.ts file where all the test cases are located.

I've already added the support for frag and it wraps the passed content(in last commit). The only problem I have now is that it adds unnecessary <></> (I understand why, just searching for a better solution).

Quick question: since <></> is not a valid HTML tag, what should the snippet provide if the jsx.enabled: true option is not set? Should it just return an empty string, or should it work regardless of that option?

wavilikhin avatar Dec 17 '24 16:12 wavilikhin