-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 cli auto completion #8529
Fix cli auto completion #8529
Conversation
Allow parsing incomplete statements while in COMPLETE context
The cli autocompletion was inserting a backslash between words and duplicating the last word This commit fixes the issue building the commandCompleter as ArgumentCompleters
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.
Thanks
.map(value -> value.toLowerCase(ENGLISH)) | ||
.collect(toSet())) | ||
.build()); | ||
return new AggregateCompleter(buildArgumentCompleter("CREATE", singletonList("TABLE")), |
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.
Can we have also SCHEMA? Can we also have other statements too like ALTER TABLE/SCHEMA
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 initially kept the list of commands as it was before, but sure. I added those you suggested.
d954dd7
to
ebf9adf
Compare
@@ -22,17 +22,17 @@ | |||
import java.util.List; | |||
|
|||
import static java.util.Arrays.asList; | |||
import static java.util.Collections.singletonList; |
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.
Let's keep this fixup
commit as separate commit as you are adding new functionality. So commit message could be just Add additional commands to cli completion
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.
Sounds good @kokosing. Applied
ebf9adf
to
60af3c1
Compare
@cla-bot check |
The exceptions still show in version 360. |
@lcx412 make sure you are Trino CLI version >= 360. This was not a change in Trino server and the server version doesn't matter for this bug. If you can still reproduce with Trino CLI >= 360, please share the stack trace/output so we can debug. |
@hashhar |
tab
.COMPLETE
ParseContext