Skip to content
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

String completions are inconsistent between JSX attributes and JSX expressions #56181

Open
Andarist opened this issue Oct 23, 2023 · 0 comments
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone

Comments

@Andarist
Copy link
Contributor

πŸ”Ž Search Terms

string completions jsx attribute expression

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.3.0-dev.20231023#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wG4BYAKCoBMk0AbFIuTAVwDsNgIO4AVJAGcYACjA4wQgFxwA3nAkQws-CnxwAvgEpZHNgwYVKdRsyStO3XgOFilU2QoeqARhp16DRqlQA8giKKkgC8+BoA9AB8pHAREXAA5CiJcAA+Sa6J-oHwDiFy4ZpxMXEJydmUQA

πŸ’» Code

import React from "react";

declare function Test(props: { prop: "a" }): null;
declare function Test(props: { prop: "b" }): null;

<Test prop="" />; // 'a' | 'b'
<Test prop={""} />; // 'a'

πŸ™ Actual behavior

Both sites provide different completions.

πŸ™‚ Expected behavior

Both of those sites represent the very same JS code and they should provide the very same completions.

Additional information about the issue

No response

@RyanCavanaugh RyanCavanaugh added Domain: Completion Lists The issue relates to showing completion lists in an editor Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases labels Oct 23, 2023
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Completion Lists The issue relates to showing completion lists in an editor Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Projects
None yet
Development

No branches or pull requests

2 participants