-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add better autocomplete patch to playground #498
Conversation
+const edgeDirectives = new Set(['fold', 'recurse', 'optional', 'transform']) | ||
+const propertyDirectives = new Set(['filter', 'tag', 'output', 'transform']) |
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.
Will this prevent us from doing something like:
{
Root {
edge @fold @transform(op: "count") @filter(op: ">", value: ["$zero"]) @output @tag {
# ... other stuff
}
# ... other stuff
}
}
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.
It won’t prevent it, but we will not autocomplete properties after transform yet, that seems like it will be much more involved to add, although it can be explored.
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.
if a user started typing @filter
after a @transform
on an edge, will it continue the completion from there?
Imagine they are here:
{ Root { edge @fold @transform(op: "count") @fil
Will it autocomplete @filter
and its arguments?
If yes, that's great and let's merge this. If not, we should maybe add all the possible directives that could appear on edges here instead — it's not great if the autocomplete suggests broken code, but it might be worse if it pretends to not understand completely valid code...
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.
No it will not, I removed the edge filtering code for now and just left a comment about this case.
With this patch, you can autocomplete directives (with some accuracy based on the preceding field's type) and you can autocomplete fields.