Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] editor.emmet.action.updateTag fragment support #128124

Open
wenfangdu opened this issue Jul 7, 2021 · 7 comments
Open

[FR] editor.emmet.action.updateTag fragment support #128124

wenfangdu opened this issue Jul 7, 2021 · 7 comments
Assignees
Labels
emmet Emmet related issues emmet-parse Issue caused by the current Emmet parser feature-request Request for new features or functionality javascript JavaScript support issues
Milestone

Comments

@wenfangdu
Copy link
Contributor

wenfangdu commented Jul 7, 2021

Currently, when using editor.emmet.action.updateTag to rename tags, there's no way to rename the tag to be a fragment (<></>).

Also, when the editor.emmet.action.updateTag prompt shows up, hitting enter does the same thing as escape - nothing happens.

Therefore, I propose a heuristic here - if the renamed tag name is empty (hit enter), rename the tag to a fragment.

@rzhao271 rzhao271 added emmet Emmet related issues feature-request Request for new features or functionality labels Jul 7, 2021
@rzhao271 rzhao271 added this to the Backlog milestone Jul 7, 2021
@rzhao271
Copy link
Contributor

rzhao271 commented Aug 4, 2021

Changing the code to support this is easy enough, but the fragment renders as follows:

HTML fragment

I'm not sure if that's the behaviour you expect?

CC @aeschli

@rzhao271 rzhao271 added the under-discussion Issue is under discussion for relevance, priority, approach label Aug 4, 2021
@wenfangdu
Copy link
Contributor Author

@rzhao271 That looks strange, if <></> is typed by hand, it will be rendered in the same color:

image

@rzhao271
Copy link
Contributor

rzhao271 commented Aug 9, 2021

I wonder if it depends on your theme and settings?
I changed around the theme and noticed the <></> rendered in a single colour for Quiet Light and Red.

@wenfangdu
Copy link
Contributor Author

wenfangdu commented Aug 9, 2021

@rzhao271 I'm using the default dark theme with no settings and no extensions enabled.

In all the themes listed below, none could cause multiple colors for me:

image

Can you retry with no settings and no extensions enabled?

@rzhao271
Copy link
Contributor

Even with no settings and no extensions (and setting sync off), I get a different colour for the invalid token:

Sample

@wenfangdu
Copy link
Contributor Author

@rzhao271 I see, you're using <></> in the html, that's why it has different colors, I was using them in jsx and tsx files without problems. It seems like a syntax parsing and highlighting issue given <></> isn't valid html.

@rzhao271 rzhao271 added the javascript JavaScript support issues label Aug 12, 2021
@rzhao271
Copy link
Contributor

rzhao271 commented Oct 6, 2021

I took a look into this issue today. Fragment support is lacking in general. For example, even after I allow updating the tag to '' in JSX, I see the following two issues:

  1. If there's attributes in the original tag, the attributes aren't erased.
  2. I'm unable to update a fragment tag.

@rzhao271 rzhao271 modified the milestones: Backlog, October 2021 Oct 6, 2021
@rzhao271 rzhao271 added emmet-parse Issue caused by the current Emmet parser and removed under-discussion Issue is under discussion for relevance, priority, approach labels Oct 6, 2021
@rzhao271 rzhao271 modified the milestones: October 2021, On Deck Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emmet Emmet related issues emmet-parse Issue caused by the current Emmet parser feature-request Request for new features or functionality javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

2 participants