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

Allow disabling Jupyter-based completion in jupyter-repl-interaction-mode #344

Open
astoff opened this issue Oct 7, 2021 · 2 comments
Open

Comments

@astoff
Copy link
Contributor

astoff commented Oct 7, 2021

The completions provided by Jupyter are quite good in the REPL, but for a script there are better options available (for instance, a language server). This is specially true when the file being edited is local but the REPL is remote, since there's an additional delay to obtain completions from Jupyter.

So I would like to suggest a customization option to choose whether to use Jupyter for completion in jupyter-repl-interaction-mode. Ideally, this would be off by default. Another possibility would be to add jupyter-completion-at-point with a lower priority in completion-at-point-functions.

@nnicandro
Copy link
Collaborator

I would be in support of somehow lowering the priority of jupyter-completion-at-point in completion-at-point-functions. I think that would just be having it come later in the list of functions.

How would your customization option work? I'm picturing something like an additional minor mode that enables or disables Jupyter based completions. Something like jupyter-repl-completions-mode which just does the work of adding/removing jupyter-completions-at-point from completion-at-point-functions. The option can be called jupyter-repl-interaction-with-completions or something. I think its best to default to t to keep the current behavior unless there is a strong opinion to change to having completions off by default.

I think the only place in the code where a change would be needed is in the jupyter-repl-interaction-mode function.

@astoff
Copy link
Contributor Author

astoff commented Nov 16, 2021

I think that would just be having it come later in the list of functions.

Yes, using the DEPTH argument of add-hook.

How would your customization option work?

I was thinking of a variable that controls whether or not jupyter-repl-interaction-mode adds jupyter to completion-at-point-functions — therefore more of less what you described, but without introducing a special minor mode (which is perhaps a bit too fine-grained).

But I think the DEPTH trick should do the job. I would suggest trying that first and think of something else only if actually needed.

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