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

satisfies is shown on go-to-implementation #60551

Open
6 tasks done
ulugbekna opened this issue Nov 21, 2024 · 0 comments Β· May be fixed by #60801
Open
6 tasks done

satisfies is shown on go-to-implementation #60551

ulugbekna opened this issue Nov 21, 2024 · 0 comments Β· May be fixed by #60801
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@ulugbekna
Copy link

πŸ” Search Terms

"satisfies", "go-to-implementation", "go to implementation", "implementation"

βœ… Viability Checklist

⭐ Suggestion

Currently, "go to implementation" on a type functionality for typescript code in VSCode will go to places where an object of this type is created. This works

interface Person {
	name: string;
}

function f() {
	const john: Person = { name: 'John' }; // both this type annotation and `as` syntaxes show these objects as implementations of `Person` 

	const andrew = { name: 'Andrew' } as Person;

        const tyler = { name: 'Tyler' } satisfies Person; // this is not shown as an implementation of `Person` 
}

Image

πŸ“ƒ Motivating Example

Go to implementation is a very easy way to see who produces objects of a particular type.

satisfies marking a type to adhere to a particular type without creating a new variable using type annotation syntax.

πŸ’» Use Cases

  1. What do you want to use this for?
    Identify implementations of a type.

  2. What shortcomings exist with current approaches?
    None I can think of.

  3. What workarounds are you using in the meantime?
    Going to references and reading code.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Dec 2, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.8.0 milestone Dec 2, 2024
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants