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
Open
6 tasks done

satisfies is shown on go-to-implementation #60551

ulugbekna opened this issue Nov 21, 2024 · 0 comments

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant