jupyter icon indicating copy to clipboard operation
jupyter copied to clipboard

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

Open astoff opened this issue 4 years ago • 2 comments
trafficstars

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.

astoff avatar Oct 07 '21 10:10 astoff

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.

nnicandro avatar Nov 13 '21 21:11 nnicandro

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.

astoff avatar Nov 16 '21 10:11 astoff