working on a react native project here using VSCode. It appears than when a suggestion is selected:
Selection
It adds this ={}
after:
After selecting.
This gets annoying, as you would expect it to only populate key={innerIdx}
instead of key={innerIdx={}}
. I tried to turn off and on a bunch of stuff in the settings, but no luck.
Anyone knows how to solve this, without turning off the suggestion, just to kill the behaviour that adds that extra ={}
?
CodePudding user response:
To turn off specific suggestions follow the instruction below:
- find your defaultSettings.json via Preferences: Open Default Settings (JSON).
- with ctrl f search this : "typescript.preferences.jsxAttributeCompletionStyle": "auto"
- then change it from auto to none
here is the full reference for all attributes in vs code. https://code.visualstudio.com/docs/getstarted/settings
// Preferred style for JSX attribute completions.
// - auto: Insert ={}
or =""
after attribute names based on the prop type.
// - braces: Insert ={}
after attribute names.
// - none: Only insert attribute names.
"typescript.preferences.jsxAttributeCompletionStyle": "auto",
you must change it to none.