You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Attribute incorrectly added for opening JSX tag #47090
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.63.0
OS Version: Ubuntu 20.04.1
Steps to Reproduce:
Create a functional React component
Inside the element's return create a React Fragment
Inside the fragment's scope type "<" and start typing a html element name until intellisense suggests some. Type tab or enter. Instead of "button" for example, it will place "button={}"
Armando Aguirre (@armanio123)Ryan Cavanaugh (@RyanCavanaugh) This looks like a potential candidate for the TS recovery build. Even when you set "javascript.preferences.jsxAttributeCompletionStyle": "none", the = still ends up being inserted
Even when you set "javascript.preferences.jsxAttributeCompletionStyle": "none", the = still ends up being inserted
I can't reproduce that bit; are you in a tsx, which instead works on "typescript.preferences.jsxAttributeCompletionStyle" (note the "typescript")? The new snippet code does check the preference explicitly.
In any case, I've sent #47096; what was happening was that in this broken AST, it looks like an attribute, when in fact it's the tag name. 4.4 didn't have JSX attribute snippets, so never had to care about this detail.
Thanks for taking a look Jake Bailey (@jakebailey)! The VS Code recovery build will go our Tuesday. Would it be possible to get this into a published TS 4.5.4 by then?
Activity
[-]Intellisense malfunction inside React Fragment[/-][+]Attribute incorrectly added for opening JSX tag[/+]mjbvz commentedon Dec 9, 2021
Armando Aguirre (@armanio123) Ryan Cavanaugh (@RyanCavanaugh) This looks like a potential candidate for the TS recovery build. Even when you set
"javascript.preferences.jsxAttributeCompletionStyle": "none", the=still ends up being insertedRyanCavanaugh commentedon Dec 10, 2021
Matt Bierner (@mjbvz) good catch, this is annoying as heck
RyanCavanaugh commentedon Dec 10, 2021
Bring up completion and tab-complete at
butto, the new text iswhen it should be (as was in 4.4)
jakebailey commentedon Dec 10, 2021
I can't reproduce that bit; are you in a
tsx, which instead works on"typescript.preferences.jsxAttributeCompletionStyle"(note the "typescript")? The new snippet code does check the preference explicitly.In any case, I've sent #47096; what was happening was that in this broken AST, it looks like an attribute, when in fact it's the tag name. 4.4 didn't have JSX attribute snippets, so never had to care about this detail.
mjbvz commentedon Dec 10, 2021
Thanks for taking a look Jake Bailey (@jakebailey)! The VS Code recovery build will go our Tuesday. Would it be possible to get this into a published TS 4.5.4 by then?
DanielRosenwasser commentedon Dec 10, 2021
Yes, I think we can do a cherry-pick/build.