镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Jsx Attribute Completion not always works correct when tag is like <Form.Item> #47280

Closed

Description

@heroboy

Bug Report

🔎 Search Terms

Jsx Attribute Completion

🕗 Version & Regression Information

  • This is a not crash
  • This changed between versions 4.5.4 and 4.5.4
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No playground.
Please paste the code to https://github.dev/. (create a a.tsx file first)
Or use the current version vscode(1.63.2)

💻 Code

interface FormInterface {
    Item: (props: {}) => any;
    (props: {}): any;
}

declare const Form: FormInterface;

function Form2() { return <div></div> }
Form2.Item = function () { return <div></div> }

function main() {
    return <Form>
        <Form.Item></Form.Item>
        <Form.Item></Form.Item>
        <Form.Item></Form.Item>
        
    </Form>
}

🙁 Actual behavior

Type code <Form.It , select the Item in completion list, press TAB to complete.
The code become <Form.Item={}.

Even set Jsx Attribute Completion Style to none, not stop the wrong completion.

🙂 Expected behavior

When you type <Form.It press tab, and complete the code to <Form.Item
The <Form2.Item> completion is correct.

Activity

  1. fatcerberus commented on Dec 31, 2021

    @fatcerberus

    Possibly related to #47090

  2. RyanCavanaugh commented on Jan 3, 2022

    @RyanCavanaugh
    Member

    Jake Bailey (@jakebailey) might or might not be fixed by the PR you have up

  3. jakebailey commented on Jan 3, 2022

    @jakebailey
    Member

    Bruce Pascoe (@fatcerberus) There are distinct settings for JSX and TSX; you need to set it to "none" in both to fully disable it across both file types. Look for typescript.preferences.jsxAttributeCompletionStyle.

    However, this should have been fixed in 4.5.4 (even though I didn't consider dotted names when I wrote the fix).

    When I go to github.dev, I can see that they are using TS 4.5.0, which definitely predates the fix. My desktop install of VS Code 1.63.2 includes 4.5.4, and doesn't break.

    image

    Bruce Pascoe (@fatcerberus) Can you open the command palette and choose "Select TypeScript Version" to see what you are running? Are you using github.dev, or is this a normal install?

  4. fatcerberus commented on Jan 3, 2022

    @fatcerberus

    Jake Bailey (@jakebailey) I’m not the OP; I just pointed out the related issue. 😅

  5. jakebailey commented on Jan 3, 2022

    @jakebailey
    Member

    Bruce Pascoe (@fatcerberus) apologies, I clearly didn't scroll up enough.

    I looked more closely at vscode.dev/github.dev; although the menu says 4.5.0 (vscode.dev doesn't even let me see it), the tsserver file is actually 4.5.4, so there must be some UI bug.

    That of course unfortunately means my fix is not complete. Sigh.

  6. heroboy commented on Jan 4, 2022

    @heroboy
    Author

    hello Jake Bailey (@jakebailey) , I tried set "typescript.preferences.jsxAttributeCompletionStyle" to "none", and it works.
    Sorry I didn't notice there are two Jsx Attribute Completion Style settings.

  7. jakebailey commented on Jan 4, 2022

    @jakebailey
    Member

    I've updated #47096 to also handle these types of tag names.

  8. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions