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

Show deprecation warnings on implementations of a deprecated property #60442

Open
mjbvz opened this issue Nov 6, 2024 · 2 comments Β· May be fixed by #60454
Open

Show deprecation warnings on implementations of a deprecated property #60442

mjbvz opened this issue Nov 6, 2024 · 2 comments Β· May be fixed by #60454
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Nov 6, 2024

πŸ”Ž Search Terms

  • Deprecated implementation
  • Deprecated interface

Related #57584

πŸ•— Version & Regression Information

Not a regression

⏯ Playground Link

No response

πŸ’» Code

type I = {
    /**
     * @deprecated
     */
    text: string;
};

function f(i: I) { return i; }
f({ text: 'a' });

const a: I = { text: 'a' }
a.text;

πŸ™ Actual behavior

Currently only the last use of a.text shows as deprecatedImage

πŸ™‚ Expected behavior

It would be helpful to also render deprecations for any implementations of I.text too as these are also using the deprecated property

Additional information about the issue

No response

@RyanCavanaugh
Copy link
Member

Why is it useful to show a strikethrough in a position where you're required to provide it? You can't delete it the way you would delete a read reference to something

@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Nov 6, 2024
@mjbvz
Copy link
Contributor Author

mjbvz commented Nov 6, 2024

Two use case for the VS Code codebase:

  • If the deprecated property is optional

  • If there's a union type and one of the types is optional. We'd love to support something like this:

type I = {
    /**
     * @deprecated
     */
    text: string;
} | {
    text: { value: string; alias: string };
};

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Experience Enhancement Noncontroversial enhancements and removed Needs More Info The issue still hasn't been fully clarified labels Nov 6, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
2 participants