Skip to content
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

Feature request - Implement python auto-complete #36

Open
unhott opened this issue May 5, 2021 · 2 comments
Open

Feature request - Implement python auto-complete #36

unhott opened this issue May 5, 2021 · 2 comments

Comments

@unhott
Copy link
Contributor

unhott commented May 5, 2021

I'll take a stab at it when I get the chance (but it may be a little while)

@bartbroere
Copy link
Contributor

bartbroere commented Nov 24, 2021

Good idea, I would also like autocompletion in Starboard Notebooks. It seems pyodide already has done some work for autocompleting things that exist in the Python globals(): https://pyodide.org/en/stable/usage/api/python-api.html?highlight=complete#pyodide.console.Console.complete

Some quick results could probably be achieved by feeding the current code block up untill the location of the cursor to this method, and display the results in a suggestion box.

The javascript scope should contain a proxy to the pyodide module under the alias pyodide_py: https://pyodide.org/en/stable/usage/api/js-api.html?highlight=pyodide_py#pyodide.pyodide_py

I'll take a stab at it when I get the chance (but it may be a little while)

Same for me. I would like to make a first version of autocompletion, but let's avoid doing double work.

@bartbroere
Copy link
Contributor

bartbroere commented Nov 24, 2021

For full autocompletion, we could look at how IPython does this: https://ipython.readthedocs.io/en/stable/config/integrating.html#tab-completion

We could merge the results of Console.complete with the results from calling __dir__ on objects.

This could be extended by using IPython's _ipython_key_completion_ if the cursor is in a place where it's indexing a Python object (within square brackets).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants