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

How to get Emmet to generate a custom JSX attribute without quotes #63703

Closed
volkancakil opened this issue Nov 24, 2018 · 24 comments
Closed

How to get Emmet to generate a custom JSX attribute without quotes #63703

volkancakil opened this issue Nov 24, 2018 · 24 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@volkancakil
Copy link

volkancakil commented Nov 24, 2018

By default, when I expand an html tag with an attribute, the attribute's value gets surrounded by quotes.
I'm trying to remove the quotes generated by Emmet around the props.onClick value for custom attribute onClick.

My input (then TAB to expand):
button[onClick={props.onClick}]

Emmet's output:
<button onClick="props.onClick"></button>

What I expect (props... WITHOUT quotes):
<button onClick={props.onClick}></button>

Whereas, I want to have to specify when the expanded version wrapping with quotes.
Either rapping it around double brackets doesn't work. Is that possible with vscode.emmet?

@vscodebot
Copy link

vscodebot bot commented Nov 24, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the emmet Emmet related issues label Nov 24, 2018
@ramya-rao-a
Copy link
Contributor

@sergeche Are you aware of any customization that allows not having the quotes around the attribute value at all?

@ramya-rao-a ramya-rao-a assigned octref and unassigned ramya-rao-a Nov 28, 2018
@sergeche
Copy link

Yes, you can add additional check for React attributes here: https://github.com/emmetio/markup-formatters/blob/master/format/html.js#L232

The React attribute object contains { before: '{', after: '}' } options: https://github.com/emmetio/abbreviation/blob/master/test/attributes.js#L77

@octref octref added this to the Backlog milestone Nov 28, 2018
@ramya-rao-a
Copy link
Contributor

Thanks @sergeche!

If anyone is interested in picking this up, please submit a PR in the https://github.com/emmetio/markup-formatters repo

@ramya-rao-a ramya-rao-a added help wanted Issues identified as good community contribution opportunities feature-request Request for new features or functionality labels Nov 29, 2018
@skprabhanjan
Copy link
Contributor

@ramya-rao-a , I would like to pick this up.
Where exactly should I start ? (submitting a PR to other repo confused me, so I just want to know)
Thanks :)

@volkancakil
Copy link
Author

volkancakil commented Nov 30, 2018

@ramya-rao-a i have made a PR emmetio/markup-formatters#2
@sergeche can you check this please?

gif

@sergeche
Copy link

sergeche commented Dec 3, 2018

Available as @emmetio/expand-abbreviation@0.7.3

@ramya-rao-a
Copy link
Contributor

Thanks @sergeche!

Just waiting for a newer version of the https://github.com/emmetio/abbreviation module, and then we should be able to pull in all the upstream fixes.

@ramya-rao-a ramya-rao-a modified the milestones: Backlog, December 2018 Dec 4, 2018
@ramya-rao-a
Copy link
Contributor

@octref All that is left to do is to update vscode-emmet-helper module to consume the latest versions of the abbreviation, markup-formatter modules

@octref
Copy link
Contributor

octref commented Dec 12, 2018

@ramya-rao-a OK, will pick it up for December.

@ramya-rao-a
Copy link
Contributor

@octref I have updated the abbreviation module in the vscode-emmet-helper repo.

Updating markup-formatter to the latest v0.4.1 is not trivial.

We are currently using v0.5.10 of the expand-abbreviation module which is not compatible with the v0.4.0 version of the markup-formatter. We have 2 choices here:

For short-term I would recommend the first option.

@octref octref removed the help wanted Issues identified as good community contribution opportunities label Jan 16, 2019
@dbaeumer dbaeumer added verification-needed Verification of issue is requested verification-steps-needed Steps to verify are needed for verification labels Jan 29, 2019
@octref octref removed verification-needed Verification of issue is requested verification-steps-needed Steps to verify are needed for verification labels Feb 1, 2019
@octref
Copy link
Contributor

octref commented Feb 1, 2019

This is not fixed yet. Moving to Feb.

@octref octref reopened this Feb 1, 2019
@octref octref modified the milestones: February 2019, March 2019 Feb 24, 2019
@octref octref modified the milestones: March 2019, Backlog Mar 22, 2019
@ghost
Copy link

ghost commented Jun 9, 2019

Is this going be back in one of the next sprints?

@HaoyangFan
Copy link

currently the button.square[onClick={func}] still converts to <button className="square" onClick="func"></button> not the intended one <button className="square" onClick={func}></button>

Is there a way to get the intended behavior? Thanks

@promethyttrium
Copy link

Is there anyone working on this?

@kylegillen
Copy link

Any update on this?

@shaltai
Copy link

shaltai commented Mar 22, 2020

Hello?

@daig
Copy link

daig commented Mar 25, 2020

Bump

2 similar comments
@dropsonic
Copy link

Bump

@loqusion
Copy link

Bump

@sergeche
Copy link

Sadly, I was unable to contact anyone at VSCode team to help me and support/sponsor new plugin development.
This feature is already available in upcoming Sublime Text plugin and works in CodePen with recent Emmet version.

@icorbrey
Copy link

Is this functionality available in an extension? Since there's not a whole ton of feedback from the team

@sergeche
Copy link

@icorbrey it’s available in core Emmet module. There’s a draft PR with upgrade to recent Emmet v2, which seems to be abandoned: microsoft/vscode-emmet-helper#33

@octref octref removed their assignment Aug 4, 2020
@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug emmet-migration and removed feature-request Request for new features or functionality labels Oct 22, 2020
@rzhao271 rzhao271 modified the milestones: Backlog, November 2020 Nov 16, 2020
@rzhao271
Copy link
Contributor

rzhao271 commented Jan 6, 2021

\closedWith dc5a3da

@meganrogge meganrogge added the verified Verification succeeded label Jan 26, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

17 participants