Code completion issue
See original GitHub issueHi, currently the auto formatting in VSCode gives me PascalCase entity relations but according to the docs this is kind of an anti-pattern.
I’m also very sure that this was not the case just a while ago. Not sure when exactly this changed. Is this a bug or did the convention actually change recently?
I’m on Prisma Extension 2.6.0 and I’m using prisma cli and client in version 2.6.0 as well.
Input:
model TestModel {
id String @id @default(cuid())
testModel OtherTestModel
}
model OtherTestModel {
id String @id @default(cuid())
}
Output after save:
model TestModel {
id String @id @default(cuid())
testModel OtherTestModel @relation(fields: [otherTestModelId], references: [id])
otherTestModelId String
}
model OtherTestModel {
id String @id @default(cuid())
TestModel TestModel[] // <- this should be camelCase?!
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Code completion | IntelliJ IDEA Documentation - JetBrains
This section covers various techniques of context-aware code completion that allow you to speed up your coding process.
Read more >Code completion not working · Issue #177 - GitHub
The internal issue is that javaCode is not being set when the code cannot compile, which for code completion is always the case....
Read more >IntelliSense in Visual Studio Code
IntelliSense is a general term for various code editing features including: code completion, parameter info, quick info, and member lists.
Read more >Intelligent code completion - Wikipedia
Intelligent code completion is a context-aware code completion feature in some programming environments that speeds up the process of coding applications by ...
Read more >PyCharm Code Completion for files outside project directory
The issue is that coding these external packages there is no code completion in regard to the main apps code.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Alright @janpio, thank you for your investigation, I’m going to do as you advise 😇
That version is from December last year, https://github.com/prisma/prisma/releases/tag/2.0.0-preview019. Back then the CLI was still called
prisma2. Unfortunately that did not includeformatas command yet, and I could not figure out easily which VSCode extension version was current back then. Going by the date, it could have been around ~0.0.20 which I could install in my VSCode. Buuuuut - it does not format my schema at all for some reason - so I can not reproduce.But we indeed did relations totally different back then and only changed it during the beta period. So I would say that of course you are getting older (every day), what you are remembering might indeed be true. It might also be that back then we did not add any back relation fields at all really, that also got only added at a certain point, but I can not find that out right now.
So for now I would close this as “works as intended” and would ask you to possibly create an issue at https://github.com/prisma/prisma/ if you care about this behavior of the formatter (because the VSCode extension only uses that for this functionality, so the issue is better over there).