Skip to content

Deprecate ScriptElementKind.jsxAttribute - #47414

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:remove-jsx-attribute
Jan 18, 2022
Merged

Deprecate ScriptElementKind.jsxAttribute#47414
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
jakebailey:remove-jsx-attribute

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented Jan 12, 2022

Copy link
Copy Markdown
Member

SymbolKind.getSymbolKind's handling of JSX attributes appears to be pretty broken (and has been for a while), but doesn't seem to have been noticed (or at least reported) by anyone until the JSX attribute snippet feature started using it as a way to detect that an attribute was being completed (#47090, #47280).

For example:

image

Rather than attempt to fix it by introducing contextToken into the mix (which I attempted in a revision of #47096), we decided that it was inconsistent that this function (which mainly powers the parenthesized string at the beginning of tooltips) uses syntactic context at all, as opposed to just describing the symbol.

This PR eliminates jsxAttribute entirely, which means that JSX attributes, tag names, etc, will all show as variables/properties/etc, the same as they would be shown when used in other places (since JSX attributes are just properties on a parameter object), eliminating the broken logic used to detect attributes.

Now:

image

image

image

image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't part of the decision to deprecate jsxAttribute, but I think it's a good idea.

@jakebailey
Jake Bailey (jakebailey) merged commit 2635102 into microsoft:main Jan 18, 2022
@jakebailey
Jake Bailey (jakebailey) deleted the remove-jsx-attribute branch January 18, 2022 21:53
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants