language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

make @@map autocomplete lowercase plural version of the model

Open deadcoder0904 opened this issue 2 years ago • 2 comments

Problem

The tables are created in Pascal Case. Most of the time developers rename it to lowercase.

Suggested solution

When someone does @@map, they specifically want to make a plural lowercase version of the model. Userusers

Alternatives

Nope.

This is a long shot but would make for great DX.

PS: Prisma VSCode Extension is the best with all the errors, linting & formatting!

deadcoder0904 avatar Nov 29 '21 07:11 deadcoder0904

Thanks for the suggestion. A few clarifying questions:

The tables are created in Pascal Case.

Where and how exactly? Models by default are created in the database using the exact same spelling used in the Prisma schema.

When someone does @@map, they specifically want to make a plural lowercase version of the model. Userusers

That is a probably fair statement.

But what is the suggestion based off of this? The title says make @@map autocomplete lowercase plural version of the model - but which auto completion does this refer to? Where should what exactly happen when I type?

PS: Prisma VSCode Extension is the best with all the errors, linting & formatting!

Thanks 💚

janpio avatar Nov 29 '21 11:11 janpio

Where and how exactly? Models by default are created in the database using the exact same spelling used in the Prisma schema.

Yes true but every Prisma docs show us to use Pascal Case so people mimic as we're mimetic creatures.

which auto completion does this refer to? Where should what exactly happen when I type?

When I type @@map, it automatically autocompletes to @@map("") so it should also provide the plural version inside ""

If the user doesn't like the suggestion, they can keep typing their model name & it will be gone.

deadcoder0904 avatar Nov 29 '21 14:11 deadcoder0904