2

TLDR version: How to make JupyterLab Autocomplete case insensitive?

I would like to have Visual Studio Code style Intellisesne(prediction and auto complete) in jupyterlab. Currently, I find jupyterlab's auto complete feature to be very basic. It only provides suggestions if the case matches and the alphabets are consecutive.

If there is any extension that can be installed or a setting that needs to be tweaked, I will be very happy. The closest question I found on Stack Overflow was Code autocompletion failed in Jupyterlab on Windows 10 However, It did not provide any useful info. I have included my jupyter details at the end.

For a clearer understanding of what I mean, please take a look at the below screenshots.

In VS Code, If I type 's', it suggests all variables beginning with the letter "S", irrespective of upper/lower case. However, in Jupyter Lab, it is case sensitive(It gets very irritating if it is case sensitive since I tend to use CamelCase quite often when naming variables).

Even Thonny, an awesome IDE created for teaching kids, has case-insensitive auto complete.

VS-Code goes one step further and matches variable names even if you skip a few characters in the variable's name. For example, in the attached image, you can see I just typed "spegg" and VS-Code understood I was aiming for "Spoilt_eggs"

VS-Code

Thonny-IDE

Jupyter-Lab

In jupyterLab, If i type "S" and hit tab, it shows all variables whose names start with "S". If I type "s" and hit tab, It shows variables that start with "s". I would like it to suggest everything with "S/s" irrespective of case.

I had also installed some extensions or something to get jupyter to work in VS-Code. However, even in this mode(Jupyter inside VS-Code), the Visual Studio-Code Intellisense is not being used. It is reverting to the same autocomplete being used by JupyterLab in the browser(Case sensitive).

Jupyter__in__VS-Code

I am a self taught python programming amateur. Learnt in IDLE, then moved to VS-Code & Thonny, now JupyterLab(& thonny for debugging). I must say I am liking JupyterLab very much but am very unhappy with the Auto Complete.

If there is any extension that needs to be installed or a setting that needs to be tweaked, I will be very happy. My VS-Code extension says it uses something called Pylance. Is there any way to get Pylance onto JupyterLab?

My !jupyter --version output is :

jupyter core     : 4.6.3
jupyter-notebook : 5.7.8
qtconsole        : 4.7.3
ipython          : 5.9.0
ipykernel        : 4.10.1
jupyter client   : 5.3.4
jupyter lab      : 0.33.12
nbconvert        : 5.6.1
ipywidgets       : 7.6.5
nbformat         : 4.4.0
traitlets        : 4.3.3

I installed python from the pythonsetup.exe available in the python website. After that, I installed jupyterLab using pip.

  • 1
    There’s a lot going on in this question - you might have more luck being more targeted. “Are there any plugins that have this type of feature?” Is a great question for a jupyterlab community forum. “Is there a way to configure my autocomplete plugin to be case insensitive?” Is a good question that should be targeted to the plug-in you’re using (which is?). And there’s a ton of narrative and repetition that makes the q hard to follow and just long (e.g. we know what case insensitive means). I don’t know the answer but cleaning this up a bit might make an answer more likely. Good luck! – Michael Delgado May 14 '22 at 18:06
  • Also since you mentioned vscode - there is a [vscode plug-in that allows you to work with jupyter notebooks](https://code.visualstudio.com/docs/datascience/jupyter-notebooks). That would mean not using jupyterlab, but maybe that gives you what you want? Otherwise, I don’t think the vscode tag is relevant here - the tag shouldn’t be used just as an example of how you want jupyterlab to work as it will spam actual vscode experts on stack overflow. – Michael Delgado May 14 '22 at 18:13
  • @MichaelDelgado I have tried using jupyter in VS-code. Please see the fourth screenshot. It is overriding VS-Code's autocomplete feature and behaving just like jupyter's own autocomplete. I am thinking of removing the VS-Code tag but if any VS-Code experts can guide me how to get VSC's autocomplete while using jupyter in VSC, I will be just as happy. – Chandradhar Koneti May 15 '22 at 10:46
  • @MichaelDelgado You said *"Is there a way to configure my autocomplete plugin to be case insensitive?(which is?)"*. I am not using any plugin in jupyterLab. It is the standard autocomplete feature. – Chandradhar Koneti May 15 '22 at 11:05

1 Answers1

1

I reproduced your question. I found that there is no problem. (If you install the python extension).

enter image description here

You can install the python extension according to the following picture:

enter image description here

Jupyter and pylance is included in "python" extension.

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13
  • 1
    I have the python extension installed. Yours is v2022, mine is 2020. Maybe I need to update my extension and see. Is there any way to backup my extension before updating it(so that I can restore the old extension if need be)? (I generally do not update things coz my experience is that updates break more stuff than they fix). – Chandradhar Koneti May 19 '22 at 08:47
  • @Chandradhar Koneti In the lower left corner of vscode, there is an "Account" icon, which can log in, save and synchronize settings. – MingJie-MSFT May 20 '22 at 01:12
  • It works in VS-code after updating VS code and the extensions. However, I would like it a lot if it could work in the browser too. I want that pylance like auto-complete feature to work in jupyter in edge. – Chandradhar Koneti May 29 '22 at 14:10
  • VS Code works alright-ish, but I regularly depend on jupytext add-on from the jupyterlab extensions place. That extension pairs my .ipynb notebok with a markdown file which makes git very easy. The .ipynb files are not readable by git easily, the way .py or .txt files can be read. I use Github Desktop and Gitlens VS_code extensions to manage my repositories. The paired markdown file make the notebook readable in GIT. So, I NEED to work in edge itself. I would very much like to have pylance in jupyterlab in edge. – Chandradhar Koneti Jun 05 '22 at 09:38
  • Could you please take a look at [This](https://stackoverflow.com/q/73798728/15065496) question. I have overcome the issue of jupytext in VS-Code but [This](https://stackoverflow.com/q/73798728/15065496) issue is really bugging me. Renders VS-Code jupyter unusable. – Chandradhar Koneti Sep 23 '22 at 05:55