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 type definitions in vscode #1705

Open
jelmd opened this issue Apr 21, 2024 · 0 comments
Open

show type definitions in vscode #1705

jelmd opened this issue Apr 21, 2024 · 0 comments
Labels
kind/feature A request for a new feature. team/schema Issue for team Schema. tech/typescript Issue for tech TypeScript. topic: jump-to-definition

Comments

@jelmd
Copy link

jelmd commented Apr 21, 2024

Problem

If one tries to write down a prisma query in vscode and gets an error, it is pretty hard to find the real problem, especially when the documentation is as shallow/incomplete as or partially simply wrong as the prisma documentation (see query examples for n-m-relationship).

E.g. for:

var clause = {
  events: {
    some: {
      event: { xeid: id }
    }
  }
};
return prisma.season.findMany({ where: clause });

vscode moans:

Type '{ event: { some: { event: { xeid: number; }; }; }; }' is not assignable to type 'SeasonWhereInput'.
  The types of 'event.some.event' are incompatible between these types.
    Type '{ xeid: number; }' is not assignable to type '(Without<EventRelationFilter, EventWhereInput> & EventWhereInput) | (Without<EventWhereInput, EventRelationFilter> & EventRelationFilter) | undefined'.ts(2322)
(property) where?: Prisma.SeasonWhereInput | undefined
Filter, which Seasons to fetch.

View Problem (Alt+F8)
No quick fixes available

If one right clicks on it or copies the term into the code, auto completion try says Cannot find name 'SeasonWhereInput'.ts(2304) (and thus one wonders, how it can know, what's wrong, if it does not know the definitions ...).

Suggested solution

Would be nice, if one could right click on SeasonWhereInput and get a "Go to Type" or "Go to Definition" or "Go to Implementation" as for other JS functions/vars/types within the project source code.

env

vscode 1.88.1
PrismaExtension v5.12.1
node v18.17.1
prisma 5.12.1
@prisma/client 5.12.1
OS: Ubuntu 20.04.6 LTS
@Druue Druue added kind/feature A request for a new feature. tech/typescript Issue for tech TypeScript. team/schema Issue for team Schema. topic: jump-to-definition labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. team/schema Issue for team Schema. tech/typescript Issue for tech TypeScript. topic: jump-to-definition
Projects
None yet
Development

No branches or pull requests

2 participants