-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suggestions for jsx attributes should include ="" #38891
Comments
Potentially related to #25207 If there is enough interest in this, we should also consider what happens when a user wants to write: |
@mjbvz webstorm/pycharm etc... has an option for completion on jsx attributes to be |
IMO the options should be
(wording negotiable). An option for quotes always is nonsense. What to do for union types that include strings and non-strings, or for |
Based on type makes sense to me as, it can also be used to avoid adding the suggestion to boolean attributes. For the union types scenario, unless is union with Options:
|
Just wanted to leave a big thank you for adding this, super helpful 😄 |
If I have it set to braces, it will auto complete a given attribute with braces once. |
I can’t reproduce that behavior: Kapture.2022-08-15.at.12.20.29.mp4Feel free to file a new issue with more repro info. This one should have been closed as completed. |
It would be nice to auto add braces / quotes when This is VSCode: 2022-11-23.14.03.33.movAnd this is WebStorm: 2022-11-23.14.05.36.mov |
@Strate I think that would require a new VS Code API; there’s nothing that I know of where an editor asks us to auto-insert code upon insertion of a previous character. Feel free to leave your suggestion on the VS Code repo (be sure to search for duplicates first). |
@andrewbranch isn't auto-closing jsx tag almost same feature? 2022-11-24.13.28.57.mov |
That feature exists purely on the VS Code side; they don’t ask TypeScript for any info to make that happen. |
TS Template added by @mjbvz
TypeScript Version: 3.9.4
Search Terms
In vscode the autocomplete for className just adds
className
in webstorm it addsclassName=""
is there a way in vscode to get it to add the additional =""?I'm not sure currently where the autocomplete comes from, whether it is inbuilt into vscode or comes from the React plugin I use (although it doesn't appear to be in their snippets).
https://github.com/dsznajder/vscode-es7-javascript-react-snippets
The text was updated successfully, but these errors were encountered: