-
Notifications
You must be signed in to change notification settings - Fork 32
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
fix(completion): suggest @id for enum and ignore comments #1192
Conversation
🤖 Pull request artifacts
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding to Jan's comments, lgtm
} | ||
|
||
const modelOrEnum = getModelOrTypeOrEnumBlock(fieldType, lines) | ||
const isAtIdAllowed = fieldType === 'Int' || fieldType === 'String' || modelOrEnum?.type === 'enum' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we allow ids on basically everything except relation fields, so it doesn't need to be restricted to Int and String. These are terrible, terrible ideas of course, but you can have id DateTime @id
or id Float @id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's actually ok to not suggest it then 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is an interesting fundametnal discussion: Do we want to suggest all the things that validate, or only the things we want to encourage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With id DateTime @id
id Float @id
it sounds very bad
Maybe we should still suggest it because a handful of people would actually know how to use that. But then it's a "foot gun" for most people, I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a comment for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update per discussion on slack:
It is possible to display hints / tooltips
Therefore, I am of the mind that we enable @id
for all fields that are already supported in engines. Then we can work on adding these tooltips for usage of @id
on fields that wouldn't be recommended with an explanation as to why.
closes #1084
Added
@id
suggestion after an enum