-
Notifications
You must be signed in to change notification settings - Fork 20
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 autocompletion capabilities to the kernel #5
Comments
very rough ideasbackgroundAlthough I have experience in writing lexer and parser(have taken a compiler course and get 99 scores), but reinvent the wheel is risky, because it has very little use and probably has a lot of bugs. the list of candidates
the choice of the toolthe priority as follows. 1 > 2 > 3
In the end, I would try to use these tools to implement the auto-completion feature. |
As part of the Jupyter Messaging protocol, the Jupyter frontend sends a
complete_requestmessage to the MariaDB kernel when the user invokes the code completer in a Jupyter notebook.This message is handled in the do_complete function from the
MariaDBKernelclass.In simpler words, whenever the user hits the key shortcut for code autocompletion in a notebook, the MariaDB kernel's
do_completefunction is called with a number of arguments that help the kernel understand what the user wants to autocomplete.So the autocompletion infrastructure in the MariaDB kernel is already kindly provided by Jupyter, we only need to send back to Jupyter a list of suggestions based on the arguments that
do_completereceives :-).Ideally we should aim to enable at least database, table and column name completion and also SQL keyword completion.
We should try to not reinvent the wheel here and see if there are some tools around to help us provide this feature with less development effort.
The MariaDB command-line client already has some autocompletion capability, we should first consider using that if possible. Also mycli has some nice autocompletion and their Python API seems quite nice, it is a good candidate as well. If no existing tools can help, we can consider implementing this from scratch.
The text was updated successfully, but these errors were encountered: