How can I get function parameter hint?

Hi,

In my notebook, I can get hints for local variable names and methods, but I cannot get parameter hints for methods. After I type in the method name and hit tab, I get a list of keywords that are available in the context, starting with a. This hint is useless.

In other jupyter-like hosted notebooks, like Google CoLab, I can get parameter hints as expected.

Is there some configuration I missed, or I need some plug-ins?

Thanks

1 Like

Completions can provided by kernel, from the editor context, or by extensions.

If you are using ipykernel you can configure IPython to generate completions using the alternative completer:

%config IPCompleter.use_jedi = False
%config Completer.evaluation = 'limited'

You can get even more completions with “unsafe” evaluation but it is, well unsafe.

Also, you can use jupyterlab-lsp extension to get completions from language serves; the exact completions depend on which language serve you chosoe and how you configure it.

2 Likes

Thanks.

With jedi=False, I get better completion. However, it does not give the argument list in the same order as the function definition. I guess I will turn on the documentation panel all the time. :smiley:

3 Likes

Fixing that is on the horizon, as soon as someone (probably myself) has time to rebase and update Sort parameter completions first and in the signature order by joelostblom · Pull Request #13673 · ipython/ipython · GitHub

2 Likes

Thanks :pray:

I tried the LSP plugin and the code completion and hint work well. But the linting warnings are annoying. I think LSP in notebook is not the right use case.

1 Like

Then disable the linting - either specific rules which do not work for your notebooks, or altogether. the LSP extension is fully modular, nothing is mandatory.

1 Like